
(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 13 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a b c i) :precision binary64 (* 2.0 (- (+ (* x y) (* z t)) (* (* (+ a (* b c)) c) i))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return 2.0 * (((x * y) + (z * t)) - (((a + (b * c)) * c) * i));
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
code = 2.0d0 * (((x * y) + (z * t)) - (((a + (b * c)) * c) * i))
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return 2.0 * (((x * y) + (z * t)) - (((a + (b * c)) * c) * i));
}
def code(x, y, z, t, a, b, c, i): return 2.0 * (((x * y) + (z * t)) - (((a + (b * c)) * c) * i))
function code(x, y, z, t, a, b, c, i) return Float64(2.0 * Float64(Float64(Float64(x * y) + Float64(z * t)) - Float64(Float64(Float64(a + Float64(b * c)) * c) * i))) end
function tmp = code(x, y, z, t, a, b, c, i) tmp = 2.0 * (((x * y) + (z * t)) - (((a + (b * c)) * c) * i)); end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(2.0 * N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] - N[(N[(N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision] * c), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
2 \cdot \left(\left(x \cdot y + z \cdot t\right) - \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i\right)
\end{array}
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ a (* b c))))
(if (<= (- (+ (* x y) (* z t)) (* (* c t_1) i)) INFINITY)
(* 2.0 (- (fma x y (* z t)) (* t_1 (* c i))))
(* -2.0 (* c (* t_1 i))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = a + (b * c);
double tmp;
if ((((x * y) + (z * t)) - ((c * t_1) * i)) <= ((double) INFINITY)) {
tmp = 2.0 * (fma(x, y, (z * t)) - (t_1 * (c * i)));
} else {
tmp = -2.0 * (c * (t_1 * i));
}
return tmp;
}
function code(x, y, z, t, a, b, c, i) t_1 = Float64(a + Float64(b * c)) tmp = 0.0 if (Float64(Float64(Float64(x * y) + Float64(z * t)) - Float64(Float64(c * t_1) * i)) <= Inf) tmp = Float64(2.0 * Float64(fma(x, y, Float64(z * t)) - Float64(t_1 * Float64(c * i)))); else tmp = Float64(-2.0 * Float64(c * Float64(t_1 * 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]}, If[LessEqual[N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] - N[(N[(c * t$95$1), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision], Infinity], N[(2.0 * N[(N[(x * y + N[(z * t), $MachinePrecision]), $MachinePrecision] - N[(t$95$1 * N[(c * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(-2.0 * N[(c * N[(t$95$1 * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a + b \cdot c\\
\mathbf{if}\;\left(x \cdot y + z \cdot t\right) - \left(c \cdot t_1\right) \cdot i \leq \infty:\\
\;\;\;\;2 \cdot \left(\mathsf{fma}\left(x, y, z \cdot t\right) - t_1 \cdot \left(c \cdot i\right)\right)\\
\mathbf{else}:\\
\;\;\;\;-2 \cdot \left(c \cdot \left(t_1 \cdot i\right)\right)\\
\end{array}
\end{array}
if (-.f64 (+.f64 (*.f64 x y) (*.f64 z t)) (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i)) < +inf.0Initial program 95.3%
associate-*l*98.0%
fma-def98.0%
Simplified98.0%
if +inf.0 < (-.f64 (+.f64 (*.f64 x y) (*.f64 z t)) (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i)) Initial program 0.0%
Taylor expanded in i around inf 63.8%
Taylor expanded in i around 0 63.8%
Final simplification96.6%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ a (* b c))) (t_2 (* (* c t_1) i)))
(if (or (<= t_2 -5e+231) (not (<= t_2 1e+289)))
(* -2.0 (* c (* t_1 i)))
(* 2.0 (- (+ (* x y) (* z t)) (+ (* (* c i) (* b c)) (* a (* c 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) * i;
double tmp;
if ((t_2 <= -5e+231) || !(t_2 <= 1e+289)) {
tmp = -2.0 * (c * (t_1 * i));
} else {
tmp = 2.0 * (((x * y) + (z * t)) - (((c * i) * (b * c)) + (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) :: t_2
real(8) :: tmp
t_1 = a + (b * c)
t_2 = (c * t_1) * i
if ((t_2 <= (-5d+231)) .or. (.not. (t_2 <= 1d+289))) then
tmp = (-2.0d0) * (c * (t_1 * i))
else
tmp = 2.0d0 * (((x * y) + (z * t)) - (((c * i) * (b * c)) + (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 = a + (b * c);
double t_2 = (c * t_1) * i;
double tmp;
if ((t_2 <= -5e+231) || !(t_2 <= 1e+289)) {
tmp = -2.0 * (c * (t_1 * i));
} else {
tmp = 2.0 * (((x * y) + (z * t)) - (((c * i) * (b * c)) + (a * (c * i))));
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = a + (b * c) t_2 = (c * t_1) * i tmp = 0 if (t_2 <= -5e+231) or not (t_2 <= 1e+289): tmp = -2.0 * (c * (t_1 * i)) else: tmp = 2.0 * (((x * y) + (z * t)) - (((c * i) * (b * c)) + (a * (c * i)))) return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(a + Float64(b * c)) t_2 = Float64(Float64(c * t_1) * i) tmp = 0.0 if ((t_2 <= -5e+231) || !(t_2 <= 1e+289)) tmp = Float64(-2.0 * Float64(c * Float64(t_1 * i))); else tmp = Float64(2.0 * Float64(Float64(Float64(x * y) + Float64(z * t)) - Float64(Float64(Float64(c * i) * Float64(b * c)) + Float64(a * Float64(c * i))))); 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; tmp = 0.0; if ((t_2 <= -5e+231) || ~((t_2 <= 1e+289))) tmp = -2.0 * (c * (t_1 * i)); else tmp = 2.0 * (((x * y) + (z * t)) - (((c * i) * (b * c)) + (a * (c * i)))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(c * t$95$1), $MachinePrecision] * i), $MachinePrecision]}, If[Or[LessEqual[t$95$2, -5e+231], N[Not[LessEqual[t$95$2, 1e+289]], $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[(N[(N[(c * i), $MachinePrecision] * N[(b * c), $MachinePrecision]), $MachinePrecision] + N[(a * N[(c * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a + b \cdot c\\
t_2 := \left(c \cdot t_1\right) \cdot i\\
\mathbf{if}\;t_2 \leq -5 \cdot 10^{+231} \lor \neg \left(t_2 \leq 10^{+289}\right):\\
\;\;\;\;-2 \cdot \left(c \cdot \left(t_1 \cdot i\right)\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(\left(x \cdot y + z \cdot t\right) - \left(\left(c \cdot i\right) \cdot \left(b \cdot c\right) + a \cdot \left(c \cdot i\right)\right)\right)\\
\end{array}
\end{array}
if (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < -5.00000000000000028e231 or 1.0000000000000001e289 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) Initial program 77.5%
Taylor expanded in i around inf 90.4%
Taylor expanded in i around 0 90.4%
if -5.00000000000000028e231 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 1.0000000000000001e289Initial program 98.8%
associate-*r*99.3%
*-commutative99.3%
+-commutative99.3%
distribute-lft-in99.3%
Applied egg-rr99.3%
Final simplification96.2%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* 2.0 (* z t)))
(t_2 (* -2.0 (* b (* c (* c i)))))
(t_3 (* 2.0 (* x y))))
(if (<= c -2.75e+48)
t_2
(if (<= c -2.1e-147)
t_1
(if (<= c 1.9e-289)
t_3
(if (<= c 4.5e-261)
t_1
(if (<= c 2.55e-26)
t_3
(if (<= c 2.8e+42)
t_1
(if (or (<= c 8.5e+128) (not (<= c 3.2e+148)))
t_2
(* c (* -2.0 (* a i))))))))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = 2.0 * (z * t);
double t_2 = -2.0 * (b * (c * (c * i)));
double t_3 = 2.0 * (x * y);
double tmp;
if (c <= -2.75e+48) {
tmp = t_2;
} else if (c <= -2.1e-147) {
tmp = t_1;
} else if (c <= 1.9e-289) {
tmp = t_3;
} else if (c <= 4.5e-261) {
tmp = t_1;
} else if (c <= 2.55e-26) {
tmp = t_3;
} else if (c <= 2.8e+42) {
tmp = t_1;
} else if ((c <= 8.5e+128) || !(c <= 3.2e+148)) {
tmp = t_2;
} else {
tmp = c * (-2.0 * (a * i));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: tmp
t_1 = 2.0d0 * (z * t)
t_2 = (-2.0d0) * (b * (c * (c * i)))
t_3 = 2.0d0 * (x * y)
if (c <= (-2.75d+48)) then
tmp = t_2
else if (c <= (-2.1d-147)) then
tmp = t_1
else if (c <= 1.9d-289) then
tmp = t_3
else if (c <= 4.5d-261) then
tmp = t_1
else if (c <= 2.55d-26) then
tmp = t_3
else if (c <= 2.8d+42) then
tmp = t_1
else if ((c <= 8.5d+128) .or. (.not. (c <= 3.2d+148))) then
tmp = t_2
else
tmp = c * ((-2.0d0) * (a * 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 = 2.0 * (z * t);
double t_2 = -2.0 * (b * (c * (c * i)));
double t_3 = 2.0 * (x * y);
double tmp;
if (c <= -2.75e+48) {
tmp = t_2;
} else if (c <= -2.1e-147) {
tmp = t_1;
} else if (c <= 1.9e-289) {
tmp = t_3;
} else if (c <= 4.5e-261) {
tmp = t_1;
} else if (c <= 2.55e-26) {
tmp = t_3;
} else if (c <= 2.8e+42) {
tmp = t_1;
} else if ((c <= 8.5e+128) || !(c <= 3.2e+148)) {
tmp = t_2;
} else {
tmp = c * (-2.0 * (a * i));
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = 2.0 * (z * t) t_2 = -2.0 * (b * (c * (c * i))) t_3 = 2.0 * (x * y) tmp = 0 if c <= -2.75e+48: tmp = t_2 elif c <= -2.1e-147: tmp = t_1 elif c <= 1.9e-289: tmp = t_3 elif c <= 4.5e-261: tmp = t_1 elif c <= 2.55e-26: tmp = t_3 elif c <= 2.8e+42: tmp = t_1 elif (c <= 8.5e+128) or not (c <= 3.2e+148): tmp = t_2 else: tmp = c * (-2.0 * (a * i)) return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(2.0 * Float64(z * t)) t_2 = Float64(-2.0 * Float64(b * Float64(c * Float64(c * i)))) t_3 = Float64(2.0 * Float64(x * y)) tmp = 0.0 if (c <= -2.75e+48) tmp = t_2; elseif (c <= -2.1e-147) tmp = t_1; elseif (c <= 1.9e-289) tmp = t_3; elseif (c <= 4.5e-261) tmp = t_1; elseif (c <= 2.55e-26) tmp = t_3; elseif (c <= 2.8e+42) tmp = t_1; elseif ((c <= 8.5e+128) || !(c <= 3.2e+148)) tmp = t_2; else tmp = Float64(c * Float64(-2.0 * Float64(a * i))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = 2.0 * (z * t); t_2 = -2.0 * (b * (c * (c * i))); t_3 = 2.0 * (x * y); tmp = 0.0; if (c <= -2.75e+48) tmp = t_2; elseif (c <= -2.1e-147) tmp = t_1; elseif (c <= 1.9e-289) tmp = t_3; elseif (c <= 4.5e-261) tmp = t_1; elseif (c <= 2.55e-26) tmp = t_3; elseif (c <= 2.8e+42) tmp = t_1; elseif ((c <= 8.5e+128) || ~((c <= 3.2e+148))) tmp = t_2; else tmp = c * (-2.0 * (a * i)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(2.0 * N[(z * t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(-2.0 * N[(b * N[(c * N[(c * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(2.0 * N[(x * y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[c, -2.75e+48], t$95$2, If[LessEqual[c, -2.1e-147], t$95$1, If[LessEqual[c, 1.9e-289], t$95$3, If[LessEqual[c, 4.5e-261], t$95$1, If[LessEqual[c, 2.55e-26], t$95$3, If[LessEqual[c, 2.8e+42], t$95$1, If[Or[LessEqual[c, 8.5e+128], N[Not[LessEqual[c, 3.2e+148]], $MachinePrecision]], t$95$2, N[(c * N[(-2.0 * N[(a * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := 2 \cdot \left(z \cdot t\right)\\
t_2 := -2 \cdot \left(b \cdot \left(c \cdot \left(c \cdot i\right)\right)\right)\\
t_3 := 2 \cdot \left(x \cdot y\right)\\
\mathbf{if}\;c \leq -2.75 \cdot 10^{+48}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;c \leq -2.1 \cdot 10^{-147}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;c \leq 1.9 \cdot 10^{-289}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;c \leq 4.5 \cdot 10^{-261}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;c \leq 2.55 \cdot 10^{-26}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;c \leq 2.8 \cdot 10^{+42}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;c \leq 8.5 \cdot 10^{+128} \lor \neg \left(c \leq 3.2 \cdot 10^{+148}\right):\\
\;\;\;\;t_2\\
\mathbf{else}:\\
\;\;\;\;c \cdot \left(-2 \cdot \left(a \cdot i\right)\right)\\
\end{array}
\end{array}
if c < -2.7500000000000001e48 or 2.7999999999999999e42 < c < 8.50000000000000045e128 or 3.1999999999999999e148 < c Initial program 82.6%
Taylor expanded in i around inf 79.7%
Taylor expanded in c around inf 73.3%
*-commutative73.3%
unpow273.3%
Simplified73.3%
Taylor expanded in c around 0 73.3%
unpow273.3%
associate-*r*73.4%
*-commutative73.4%
associate-*l*77.4%
Simplified77.4%
if -2.7500000000000001e48 < c < -2.1e-147 or 1.90000000000000005e-289 < c < 4.5000000000000001e-261 or 2.54999999999999995e-26 < c < 2.7999999999999999e42Initial program 97.1%
Taylor expanded in z around inf 52.2%
if -2.1e-147 < c < 1.90000000000000005e-289 or 4.5000000000000001e-261 < c < 2.54999999999999995e-26Initial program 97.7%
Taylor expanded in x around inf 51.4%
if 8.50000000000000045e128 < c < 3.1999999999999999e148Initial program 67.2%
Taylor expanded in a around inf 83.8%
mul-1-neg83.8%
associate-*r*83.7%
*-commutative83.7%
distribute-rgt-neg-in83.7%
*-commutative83.7%
distribute-rgt-neg-in83.7%
Simplified83.7%
Taylor expanded in a around 0 83.8%
*-commutative83.8%
associate-*l*83.8%
*-commutative83.8%
Simplified83.8%
Final simplification62.0%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ a (* b c))))
(if (<= c 2.4e+100)
(* (- (+ (* x y) (* z t)) (* (* c t_1) i)) 2.0)
(* -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 tmp;
if (c <= 2.4e+100) {
tmp = (((x * y) + (z * t)) - ((c * t_1) * i)) * 2.0;
} else {
tmp = -2.0 * (c * (t_1 * i));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: t_1
real(8) :: tmp
t_1 = a + (b * c)
if (c <= 2.4d+100) then
tmp = (((x * y) + (z * t)) - ((c * t_1) * i)) * 2.0d0
else
tmp = (-2.0d0) * (c * (t_1 * i))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = a + (b * c);
double tmp;
if (c <= 2.4e+100) {
tmp = (((x * y) + (z * t)) - ((c * t_1) * i)) * 2.0;
} else {
tmp = -2.0 * (c * (t_1 * i));
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = a + (b * c) tmp = 0 if c <= 2.4e+100: tmp = (((x * y) + (z * t)) - ((c * t_1) * i)) * 2.0 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)) tmp = 0.0 if (c <= 2.4e+100) tmp = Float64(Float64(Float64(Float64(x * y) + Float64(z * t)) - Float64(Float64(c * t_1) * i)) * 2.0); else tmp = Float64(-2.0 * Float64(c * Float64(t_1 * i))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = a + (b * c); tmp = 0.0; if (c <= 2.4e+100) tmp = (((x * y) + (z * t)) - ((c * t_1) * i)) * 2.0; else tmp = -2.0 * (c * (t_1 * i)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[c, 2.4e+100], N[(N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] - N[(N[(c * t$95$1), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision] * 2.0), $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\\
\mathbf{if}\;c \leq 2.4 \cdot 10^{+100}:\\
\;\;\;\;\left(\left(x \cdot y + z \cdot t\right) - \left(c \cdot t_1\right) \cdot i\right) \cdot 2\\
\mathbf{else}:\\
\;\;\;\;-2 \cdot \left(c \cdot \left(t_1 \cdot i\right)\right)\\
\end{array}
\end{array}
if c < 2.40000000000000012e100Initial program 94.6%
if 2.40000000000000012e100 < c Initial program 71.2%
Taylor expanded in i around inf 92.2%
Taylor expanded in i around 0 92.2%
Final simplification94.3%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* (+ (* x y) (* z t)) 2.0)) (t_2 (* -2.0 (* b (* c (* c i))))))
(if (<= c -6.8e+59)
t_2
(if (<= c 5.6e+59)
t_1
(if (<= c 3.6e+76)
t_2
(if (<= c 2.5e+100)
t_1
(if (<= c 3.2e+148) (* c (* -2.0 (* a i))) t_2)))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = ((x * y) + (z * t)) * 2.0;
double t_2 = -2.0 * (b * (c * (c * i)));
double tmp;
if (c <= -6.8e+59) {
tmp = t_2;
} else if (c <= 5.6e+59) {
tmp = t_1;
} else if (c <= 3.6e+76) {
tmp = t_2;
} else if (c <= 2.5e+100) {
tmp = t_1;
} else if (c <= 3.2e+148) {
tmp = c * (-2.0 * (a * i));
} else {
tmp = t_2;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = ((x * y) + (z * t)) * 2.0d0
t_2 = (-2.0d0) * (b * (c * (c * i)))
if (c <= (-6.8d+59)) then
tmp = t_2
else if (c <= 5.6d+59) then
tmp = t_1
else if (c <= 3.6d+76) then
tmp = t_2
else if (c <= 2.5d+100) then
tmp = t_1
else if (c <= 3.2d+148) then
tmp = c * ((-2.0d0) * (a * i))
else
tmp = t_2
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = ((x * y) + (z * t)) * 2.0;
double t_2 = -2.0 * (b * (c * (c * i)));
double tmp;
if (c <= -6.8e+59) {
tmp = t_2;
} else if (c <= 5.6e+59) {
tmp = t_1;
} else if (c <= 3.6e+76) {
tmp = t_2;
} else if (c <= 2.5e+100) {
tmp = t_1;
} else if (c <= 3.2e+148) {
tmp = c * (-2.0 * (a * i));
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = ((x * y) + (z * t)) * 2.0 t_2 = -2.0 * (b * (c * (c * i))) tmp = 0 if c <= -6.8e+59: tmp = t_2 elif c <= 5.6e+59: tmp = t_1 elif c <= 3.6e+76: tmp = t_2 elif c <= 2.5e+100: tmp = t_1 elif c <= 3.2e+148: tmp = c * (-2.0 * (a * i)) else: tmp = t_2 return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(Float64(Float64(x * y) + Float64(z * t)) * 2.0) t_2 = Float64(-2.0 * Float64(b * Float64(c * Float64(c * i)))) tmp = 0.0 if (c <= -6.8e+59) tmp = t_2; elseif (c <= 5.6e+59) tmp = t_1; elseif (c <= 3.6e+76) tmp = t_2; elseif (c <= 2.5e+100) tmp = t_1; elseif (c <= 3.2e+148) tmp = Float64(c * Float64(-2.0 * Float64(a * i))); else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = ((x * y) + (z * t)) * 2.0; t_2 = -2.0 * (b * (c * (c * i))); tmp = 0.0; if (c <= -6.8e+59) tmp = t_2; elseif (c <= 5.6e+59) tmp = t_1; elseif (c <= 3.6e+76) tmp = t_2; elseif (c <= 2.5e+100) tmp = t_1; elseif (c <= 3.2e+148) tmp = c * (-2.0 * (a * i)); else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision]}, Block[{t$95$2 = N[(-2.0 * N[(b * N[(c * N[(c * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[c, -6.8e+59], t$95$2, If[LessEqual[c, 5.6e+59], t$95$1, If[LessEqual[c, 3.6e+76], t$95$2, If[LessEqual[c, 2.5e+100], t$95$1, If[LessEqual[c, 3.2e+148], N[(c * N[(-2.0 * N[(a * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$2]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(x \cdot y + z \cdot t\right) \cdot 2\\
t_2 := -2 \cdot \left(b \cdot \left(c \cdot \left(c \cdot i\right)\right)\right)\\
\mathbf{if}\;c \leq -6.8 \cdot 10^{+59}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;c \leq 5.6 \cdot 10^{+59}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;c \leq 3.6 \cdot 10^{+76}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;c \leq 2.5 \cdot 10^{+100}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;c \leq 3.2 \cdot 10^{+148}:\\
\;\;\;\;c \cdot \left(-2 \cdot \left(a \cdot i\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if c < -6.80000000000000012e59 or 5.5999999999999996e59 < c < 3.6000000000000003e76 or 3.1999999999999999e148 < c Initial program 85.2%
Taylor expanded in i around inf 84.2%
Taylor expanded in c around inf 80.3%
*-commutative80.3%
unpow280.3%
Simplified80.3%
Taylor expanded in c around 0 80.3%
unpow280.3%
associate-*r*80.5%
*-commutative80.5%
associate-*l*85.3%
Simplified85.3%
if -6.80000000000000012e59 < c < 5.5999999999999996e59 or 3.6000000000000003e76 < c < 2.4999999999999999e100Initial program 97.0%
Taylor expanded in c around 0 79.4%
if 2.4999999999999999e100 < c < 3.1999999999999999e148Initial program 47.1%
Taylor expanded in a around inf 62.0%
mul-1-neg62.0%
associate-*r*61.9%
*-commutative61.9%
distribute-rgt-neg-in61.9%
*-commutative61.9%
distribute-rgt-neg-in61.9%
Simplified61.9%
Taylor expanded in a around 0 62.0%
*-commutative62.0%
associate-*l*62.0%
*-commutative62.0%
Simplified62.0%
Final simplification80.5%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* (+ (* x y) (* z t)) 2.0)) (t_2 (* -2.0 (* b (* c (* c i))))))
(if (<= c -1.8e+59)
t_2
(if (<= c 2.2e+63)
t_1
(if (<= c 2.2e+76)
t_2
(if (<= c 1.58e+100)
t_1
(if (<= c 3.2e+148)
(* c (* -2.0 (* a i)))
(* c (* c (* i (* b -2.0)))))))))))
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)) * 2.0;
double t_2 = -2.0 * (b * (c * (c * i)));
double tmp;
if (c <= -1.8e+59) {
tmp = t_2;
} else if (c <= 2.2e+63) {
tmp = t_1;
} else if (c <= 2.2e+76) {
tmp = t_2;
} else if (c <= 1.58e+100) {
tmp = t_1;
} else if (c <= 3.2e+148) {
tmp = c * (-2.0 * (a * i));
} else {
tmp = c * (c * (i * (b * -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) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = ((x * y) + (z * t)) * 2.0d0
t_2 = (-2.0d0) * (b * (c * (c * i)))
if (c <= (-1.8d+59)) then
tmp = t_2
else if (c <= 2.2d+63) then
tmp = t_1
else if (c <= 2.2d+76) then
tmp = t_2
else if (c <= 1.58d+100) then
tmp = t_1
else if (c <= 3.2d+148) then
tmp = c * ((-2.0d0) * (a * i))
else
tmp = c * (c * (i * (b * (-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 t_1 = ((x * y) + (z * t)) * 2.0;
double t_2 = -2.0 * (b * (c * (c * i)));
double tmp;
if (c <= -1.8e+59) {
tmp = t_2;
} else if (c <= 2.2e+63) {
tmp = t_1;
} else if (c <= 2.2e+76) {
tmp = t_2;
} else if (c <= 1.58e+100) {
tmp = t_1;
} else if (c <= 3.2e+148) {
tmp = c * (-2.0 * (a * i));
} else {
tmp = c * (c * (i * (b * -2.0)));
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = ((x * y) + (z * t)) * 2.0 t_2 = -2.0 * (b * (c * (c * i))) tmp = 0 if c <= -1.8e+59: tmp = t_2 elif c <= 2.2e+63: tmp = t_1 elif c <= 2.2e+76: tmp = t_2 elif c <= 1.58e+100: tmp = t_1 elif c <= 3.2e+148: tmp = c * (-2.0 * (a * i)) else: tmp = c * (c * (i * (b * -2.0))) return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(Float64(Float64(x * y) + Float64(z * t)) * 2.0) t_2 = Float64(-2.0 * Float64(b * Float64(c * Float64(c * i)))) tmp = 0.0 if (c <= -1.8e+59) tmp = t_2; elseif (c <= 2.2e+63) tmp = t_1; elseif (c <= 2.2e+76) tmp = t_2; elseif (c <= 1.58e+100) tmp = t_1; elseif (c <= 3.2e+148) tmp = Float64(c * Float64(-2.0 * Float64(a * i))); else tmp = Float64(c * Float64(c * Float64(i * Float64(b * -2.0)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = ((x * y) + (z * t)) * 2.0; t_2 = -2.0 * (b * (c * (c * i))); tmp = 0.0; if (c <= -1.8e+59) tmp = t_2; elseif (c <= 2.2e+63) tmp = t_1; elseif (c <= 2.2e+76) tmp = t_2; elseif (c <= 1.58e+100) tmp = t_1; elseif (c <= 3.2e+148) tmp = c * (-2.0 * (a * i)); else tmp = c * (c * (i * (b * -2.0))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision]}, Block[{t$95$2 = N[(-2.0 * N[(b * N[(c * N[(c * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[c, -1.8e+59], t$95$2, If[LessEqual[c, 2.2e+63], t$95$1, If[LessEqual[c, 2.2e+76], t$95$2, If[LessEqual[c, 1.58e+100], t$95$1, If[LessEqual[c, 3.2e+148], N[(c * N[(-2.0 * N[(a * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(c * N[(c * N[(i * N[(b * -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(x \cdot y + z \cdot t\right) \cdot 2\\
t_2 := -2 \cdot \left(b \cdot \left(c \cdot \left(c \cdot i\right)\right)\right)\\
\mathbf{if}\;c \leq -1.8 \cdot 10^{+59}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;c \leq 2.2 \cdot 10^{+63}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;c \leq 2.2 \cdot 10^{+76}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;c \leq 1.58 \cdot 10^{+100}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;c \leq 3.2 \cdot 10^{+148}:\\
\;\;\;\;c \cdot \left(-2 \cdot \left(a \cdot i\right)\right)\\
\mathbf{else}:\\
\;\;\;\;c \cdot \left(c \cdot \left(i \cdot \left(b \cdot -2\right)\right)\right)\\
\end{array}
\end{array}
if c < -1.7999999999999999e59 or 2.1999999999999999e63 < c < 2.2e76Initial program 87.1%
Taylor expanded in i around inf 81.9%
Taylor expanded in c around inf 77.8%
*-commutative77.8%
unpow277.8%
Simplified77.8%
Taylor expanded in c around 0 77.8%
unpow277.8%
associate-*r*78.1%
*-commutative78.1%
associate-*l*83.5%
Simplified83.5%
if -1.7999999999999999e59 < c < 2.1999999999999999e63 or 2.2e76 < c < 1.5800000000000001e100Initial program 97.0%
Taylor expanded in c around 0 79.4%
if 1.5800000000000001e100 < c < 3.1999999999999999e148Initial program 47.1%
Taylor expanded in a around inf 62.0%
mul-1-neg62.0%
associate-*r*61.9%
*-commutative61.9%
distribute-rgt-neg-in61.9%
*-commutative61.9%
distribute-rgt-neg-in61.9%
Simplified61.9%
Taylor expanded in a around 0 62.0%
*-commutative62.0%
associate-*l*62.0%
*-commutative62.0%
Simplified62.0%
if 3.1999999999999999e148 < c Initial program 81.4%
Taylor expanded in i around inf 88.9%
Taylor expanded in c around inf 85.3%
*-commutative85.3%
unpow285.3%
Simplified85.3%
Taylor expanded in c around 0 85.3%
*-commutative85.3%
unpow285.3%
*-commutative85.3%
associate-*r*85.3%
associate-*l*88.9%
*-commutative88.9%
associate-*r*88.9%
Simplified88.9%
Final simplification80.5%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* (+ (* x y) (* z t)) 2.0)) (t_2 (* -2.0 (* b (* c (* c i))))))
(if (<= c -9.2e+61)
t_2
(if (<= c 1.95e+62)
t_1
(if (<= c 1.55e+76)
t_2
(if (<= c 2.2e+100)
t_1
(if (<= c 3.2e+148)
(* c (* -2.0 (* a i)))
(* c (* (* c i) (* b -2.0))))))))))
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)) * 2.0;
double t_2 = -2.0 * (b * (c * (c * i)));
double tmp;
if (c <= -9.2e+61) {
tmp = t_2;
} else if (c <= 1.95e+62) {
tmp = t_1;
} else if (c <= 1.55e+76) {
tmp = t_2;
} else if (c <= 2.2e+100) {
tmp = t_1;
} else if (c <= 3.2e+148) {
tmp = c * (-2.0 * (a * i));
} else {
tmp = c * ((c * i) * (b * -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) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = ((x * y) + (z * t)) * 2.0d0
t_2 = (-2.0d0) * (b * (c * (c * i)))
if (c <= (-9.2d+61)) then
tmp = t_2
else if (c <= 1.95d+62) then
tmp = t_1
else if (c <= 1.55d+76) then
tmp = t_2
else if (c <= 2.2d+100) then
tmp = t_1
else if (c <= 3.2d+148) then
tmp = c * ((-2.0d0) * (a * i))
else
tmp = c * ((c * i) * (b * (-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 t_1 = ((x * y) + (z * t)) * 2.0;
double t_2 = -2.0 * (b * (c * (c * i)));
double tmp;
if (c <= -9.2e+61) {
tmp = t_2;
} else if (c <= 1.95e+62) {
tmp = t_1;
} else if (c <= 1.55e+76) {
tmp = t_2;
} else if (c <= 2.2e+100) {
tmp = t_1;
} else if (c <= 3.2e+148) {
tmp = c * (-2.0 * (a * i));
} else {
tmp = c * ((c * i) * (b * -2.0));
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = ((x * y) + (z * t)) * 2.0 t_2 = -2.0 * (b * (c * (c * i))) tmp = 0 if c <= -9.2e+61: tmp = t_2 elif c <= 1.95e+62: tmp = t_1 elif c <= 1.55e+76: tmp = t_2 elif c <= 2.2e+100: tmp = t_1 elif c <= 3.2e+148: tmp = c * (-2.0 * (a * i)) else: tmp = c * ((c * i) * (b * -2.0)) return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(Float64(Float64(x * y) + Float64(z * t)) * 2.0) t_2 = Float64(-2.0 * Float64(b * Float64(c * Float64(c * i)))) tmp = 0.0 if (c <= -9.2e+61) tmp = t_2; elseif (c <= 1.95e+62) tmp = t_1; elseif (c <= 1.55e+76) tmp = t_2; elseif (c <= 2.2e+100) tmp = t_1; elseif (c <= 3.2e+148) tmp = Float64(c * Float64(-2.0 * Float64(a * i))); else tmp = Float64(c * Float64(Float64(c * i) * Float64(b * -2.0))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = ((x * y) + (z * t)) * 2.0; t_2 = -2.0 * (b * (c * (c * i))); tmp = 0.0; if (c <= -9.2e+61) tmp = t_2; elseif (c <= 1.95e+62) tmp = t_1; elseif (c <= 1.55e+76) tmp = t_2; elseif (c <= 2.2e+100) tmp = t_1; elseif (c <= 3.2e+148) tmp = c * (-2.0 * (a * i)); else tmp = c * ((c * i) * (b * -2.0)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision]}, Block[{t$95$2 = N[(-2.0 * N[(b * N[(c * N[(c * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[c, -9.2e+61], t$95$2, If[LessEqual[c, 1.95e+62], t$95$1, If[LessEqual[c, 1.55e+76], t$95$2, If[LessEqual[c, 2.2e+100], t$95$1, If[LessEqual[c, 3.2e+148], N[(c * N[(-2.0 * N[(a * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(c * N[(N[(c * i), $MachinePrecision] * N[(b * -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(x \cdot y + z \cdot t\right) \cdot 2\\
t_2 := -2 \cdot \left(b \cdot \left(c \cdot \left(c \cdot i\right)\right)\right)\\
\mathbf{if}\;c \leq -9.2 \cdot 10^{+61}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;c \leq 1.95 \cdot 10^{+62}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;c \leq 1.55 \cdot 10^{+76}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;c \leq 2.2 \cdot 10^{+100}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;c \leq 3.2 \cdot 10^{+148}:\\
\;\;\;\;c \cdot \left(-2 \cdot \left(a \cdot i\right)\right)\\
\mathbf{else}:\\
\;\;\;\;c \cdot \left(\left(c \cdot i\right) \cdot \left(b \cdot -2\right)\right)\\
\end{array}
\end{array}
if c < -9.1999999999999998e61 or 1.95e62 < c < 1.55000000000000006e76Initial program 87.1%
Taylor expanded in i around inf 81.9%
Taylor expanded in c around inf 77.8%
*-commutative77.8%
unpow277.8%
Simplified77.8%
Taylor expanded in c around 0 77.8%
unpow277.8%
associate-*r*78.1%
*-commutative78.1%
associate-*l*83.5%
Simplified83.5%
if -9.1999999999999998e61 < c < 1.95e62 or 1.55000000000000006e76 < c < 2.2000000000000001e100Initial program 97.0%
Taylor expanded in c around 0 79.4%
if 2.2000000000000001e100 < c < 3.1999999999999999e148Initial program 47.1%
Taylor expanded in a around inf 62.0%
mul-1-neg62.0%
associate-*r*61.9%
*-commutative61.9%
distribute-rgt-neg-in61.9%
*-commutative61.9%
distribute-rgt-neg-in61.9%
Simplified61.9%
Taylor expanded in a around 0 62.0%
*-commutative62.0%
associate-*l*62.0%
*-commutative62.0%
Simplified62.0%
if 3.1999999999999999e148 < c Initial program 81.4%
Taylor expanded in i around inf 88.9%
Taylor expanded in c around inf 85.3%
*-commutative85.3%
unpow285.3%
Simplified85.3%
Taylor expanded in c around 0 85.3%
*-commutative85.3%
unpow285.3%
*-commutative85.3%
associate-*r*85.3%
associate-*l*88.9%
*-commutative88.9%
associate-*r*88.9%
Simplified88.9%
Taylor expanded in c around 0 88.9%
*-commutative88.9%
associate-*r*89.0%
associate-*l*89.0%
*-commutative89.0%
Simplified89.0%
Final simplification80.5%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= c -2.15e+33) (not (<= c 7.5e+40))) (* 2.0 (- (* x y) (* 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 <= -2.15e+33) || !(c <= 7.5e+40)) {
tmp = 2.0 * ((x * y) - (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 <= (-2.15d+33)) .or. (.not. (c <= 7.5d+40))) then
tmp = 2.0d0 * ((x * y) - (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 <= -2.15e+33) || !(c <= 7.5e+40)) {
tmp = 2.0 * ((x * y) - (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 <= -2.15e+33) or not (c <= 7.5e+40): tmp = 2.0 * ((x * y) - (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 <= -2.15e+33) || !(c <= 7.5e+40)) tmp = Float64(2.0 * Float64(Float64(x * y) - Float64(c * Float64(Float64(a + Float64(b * c)) * i)))); else tmp = Float64(Float64(Float64(x * y) + Float64(z * t)) * 2.0); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if ((c <= -2.15e+33) || ~((c <= 7.5e+40))) tmp = 2.0 * ((x * y) - (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, -2.15e+33], N[Not[LessEqual[c, 7.5e+40]], $MachinePrecision]], N[(2.0 * N[(N[(x * y), $MachinePrecision] - N[(c * N[(N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;c \leq -2.15 \cdot 10^{+33} \lor \neg \left(c \leq 7.5 \cdot 10^{+40}\right):\\
\;\;\;\;2 \cdot \left(x \cdot y - c \cdot \left(\left(a + b \cdot c\right) \cdot i\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(x \cdot y + z \cdot t\right) \cdot 2\\
\end{array}
\end{array}
if c < -2.15000000000000014e33 or 7.4999999999999996e40 < c Initial program 82.4%
Taylor expanded in z around 0 87.1%
if -2.15000000000000014e33 < c < 7.4999999999999996e40Initial program 97.4%
Taylor expanded in c around 0 81.2%
Final simplification83.6%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= c -1.7e+36) (not (<= c 6.2e+41))) (* 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.7e+36) || !(c <= 6.2e+41)) {
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.7d+36)) .or. (.not. (c <= 6.2d+41))) 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.7e+36) || !(c <= 6.2e+41)) {
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.7e+36) or not (c <= 6.2e+41): 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.7e+36) || !(c <= 6.2e+41)) 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.7e+36) || ~((c <= 6.2e+41))) 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.7e+36], N[Not[LessEqual[c, 6.2e+41]], $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.7 \cdot 10^{+36} \lor \neg \left(c \leq 6.2 \cdot 10^{+41}\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.6999999999999999e36 or 6.2e41 < c Initial program 82.4%
Taylor expanded in z around 0 87.1%
if -1.6999999999999999e36 < c < 6.2e41Initial program 97.4%
Taylor expanded in a around inf 92.1%
Final simplification90.0%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= c -8.6e+103) (not (<= c 5.2e+42))) (* -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 <= -8.6e+103) || !(c <= 5.2e+42)) {
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 <= (-8.6d+103)) .or. (.not. (c <= 5.2d+42))) 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 <= -8.6e+103) || !(c <= 5.2e+42)) {
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 <= -8.6e+103) or not (c <= 5.2e+42): 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 <= -8.6e+103) || !(c <= 5.2e+42)) tmp = Float64(-2.0 * Float64(c * Float64(Float64(a + Float64(b * c)) * i))); else tmp = Float64(Float64(Float64(x * y) + Float64(z * t)) * 2.0); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if ((c <= -8.6e+103) || ~((c <= 5.2e+42))) 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, -8.6e+103], N[Not[LessEqual[c, 5.2e+42]], $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 -8.6 \cdot 10^{+103} \lor \neg \left(c \leq 5.2 \cdot 10^{+42}\right):\\
\;\;\;\;-2 \cdot \left(c \cdot \left(\left(a + b \cdot c\right) \cdot i\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(x \cdot y + z \cdot t\right) \cdot 2\\
\end{array}
\end{array}
if c < -8.59999999999999938e103 or 5.1999999999999998e42 < c Initial program 80.3%
Taylor expanded in i around inf 85.9%
Taylor expanded in i around 0 85.9%
if -8.59999999999999938e103 < c < 5.1999999999999998e42Initial program 97.0%
Taylor expanded in c around 0 78.9%
Final simplification81.4%
(FPCore (x y z t a b c i)
:precision binary64
(if (<= c -2.55e+48)
(* 2.0 (- (* x y) (* c (* i (* b c)))))
(if (<= c 1.7e+40)
(* (+ (* x y) (* z t)) 2.0)
(* -2.0 (* c (* (+ a (* b c)) i))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (c <= -2.55e+48) {
tmp = 2.0 * ((x * y) - (c * (i * (b * c))));
} else if (c <= 1.7e+40) {
tmp = ((x * y) + (z * t)) * 2.0;
} else {
tmp = -2.0 * (c * ((a + (b * 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 (c <= (-2.55d+48)) then
tmp = 2.0d0 * ((x * y) - (c * (i * (b * c))))
else if (c <= 1.7d+40) then
tmp = ((x * y) + (z * t)) * 2.0d0
else
tmp = (-2.0d0) * (c * ((a + (b * 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 (c <= -2.55e+48) {
tmp = 2.0 * ((x * y) - (c * (i * (b * c))));
} else if (c <= 1.7e+40) {
tmp = ((x * y) + (z * t)) * 2.0;
} else {
tmp = -2.0 * (c * ((a + (b * c)) * i));
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if c <= -2.55e+48: tmp = 2.0 * ((x * y) - (c * (i * (b * c)))) elif c <= 1.7e+40: tmp = ((x * y) + (z * t)) * 2.0 else: tmp = -2.0 * (c * ((a + (b * c)) * i)) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (c <= -2.55e+48) tmp = Float64(2.0 * Float64(Float64(x * y) - Float64(c * Float64(i * Float64(b * c))))); elseif (c <= 1.7e+40) tmp = Float64(Float64(Float64(x * y) + Float64(z * t)) * 2.0); else tmp = Float64(-2.0 * Float64(c * Float64(Float64(a + Float64(b * c)) * i))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if (c <= -2.55e+48) tmp = 2.0 * ((x * y) - (c * (i * (b * c)))); elseif (c <= 1.7e+40) tmp = ((x * y) + (z * t)) * 2.0; else tmp = -2.0 * (c * ((a + (b * c)) * i)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[c, -2.55e+48], N[(2.0 * N[(N[(x * y), $MachinePrecision] - N[(c * N[(i * N[(b * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[c, 1.7e+40], N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision], N[(-2.0 * N[(c * N[(N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;c \leq -2.55 \cdot 10^{+48}:\\
\;\;\;\;2 \cdot \left(x \cdot y - c \cdot \left(i \cdot \left(b \cdot c\right)\right)\right)\\
\mathbf{elif}\;c \leq 1.7 \cdot 10^{+40}:\\
\;\;\;\;\left(x \cdot y + z \cdot t\right) \cdot 2\\
\mathbf{else}:\\
\;\;\;\;-2 \cdot \left(c \cdot \left(\left(a + b \cdot c\right) \cdot i\right)\right)\\
\end{array}
\end{array}
if c < -2.5499999999999999e48Initial program 86.4%
Taylor expanded in z around 0 88.5%
Taylor expanded in c around inf 84.5%
if -2.5499999999999999e48 < c < 1.69999999999999994e40Initial program 97.4%
Taylor expanded in c around 0 80.5%
if 1.69999999999999994e40 < c Initial program 77.1%
Taylor expanded in i around inf 82.9%
Taylor expanded in i around 0 82.9%
Final simplification81.7%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= z -7.4e+27) (not (<= z 4.2e-16))) (* 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 <= -7.4e+27) || !(z <= 4.2e-16)) {
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 <= (-7.4d+27)) .or. (.not. (z <= 4.2d-16))) 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 <= -7.4e+27) || !(z <= 4.2e-16)) {
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 <= -7.4e+27) or not (z <= 4.2e-16): 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 <= -7.4e+27) || !(z <= 4.2e-16)) 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 <= -7.4e+27) || ~((z <= 4.2e-16))) 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, -7.4e+27], N[Not[LessEqual[z, 4.2e-16]], $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 -7.4 \cdot 10^{+27} \lor \neg \left(z \leq 4.2 \cdot 10^{-16}\right):\\
\;\;\;\;2 \cdot \left(z \cdot t\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(x \cdot y\right)\\
\end{array}
\end{array}
if z < -7.40000000000000004e27 or 4.2000000000000002e-16 < z Initial program 88.9%
Taylor expanded in z around inf 47.9%
if -7.40000000000000004e27 < z < 4.2000000000000002e-16Initial program 93.8%
Taylor expanded in x around inf 39.7%
Final simplification44.0%
(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.2%
Taylor expanded in z around inf 31.4%
Final simplification31.4%
(FPCore (x y z t a b c i) :precision binary64 (* 2.0 (- (+ (* x y) (* z t)) (* (+ a (* b c)) (* c i)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return 2.0 * (((x * y) + (z * t)) - ((a + (b * c)) * (c * i)));
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
code = 2.0d0 * (((x * y) + (z * t)) - ((a + (b * c)) * (c * i)))
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return 2.0 * (((x * y) + (z * t)) - ((a + (b * c)) * (c * i)));
}
def code(x, y, z, t, a, b, c, i): return 2.0 * (((x * y) + (z * t)) - ((a + (b * c)) * (c * i)))
function code(x, y, z, t, a, b, c, i) return Float64(2.0 * Float64(Float64(Float64(x * y) + Float64(z * t)) - Float64(Float64(a + Float64(b * c)) * Float64(c * i)))) end
function tmp = code(x, y, z, t, a, b, c, i) tmp = 2.0 * (((x * y) + (z * t)) - ((a + (b * c)) * (c * i))); end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(2.0 * N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] - N[(N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision] * N[(c * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
2 \cdot \left(\left(x \cdot y + z \cdot t\right) - \left(a + b \cdot c\right) \cdot \left(c \cdot i\right)\right)
\end{array}
herbie shell --seed 2023279
(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))))