
(FPCore (x y z t a b c i) :precision binary64 (* 2.0 (- (+ (* x y) (* z t)) (* (* (+ a (* b c)) c) i))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return 2.0 * (((x * y) + (z * t)) - (((a + (b * c)) * c) * i));
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
code = 2.0d0 * (((x * y) + (z * t)) - (((a + (b * c)) * c) * i))
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return 2.0 * (((x * y) + (z * t)) - (((a + (b * c)) * c) * i));
}
def code(x, y, z, t, a, b, c, i): return 2.0 * (((x * y) + (z * t)) - (((a + (b * c)) * c) * i))
function code(x, y, z, t, a, b, c, i) return Float64(2.0 * Float64(Float64(Float64(x * y) + Float64(z * t)) - Float64(Float64(Float64(a + Float64(b * c)) * c) * i))) end
function tmp = code(x, y, z, t, a, b, c, i) tmp = 2.0 * (((x * y) + (z * t)) - (((a + (b * c)) * c) * i)); end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(2.0 * N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] - N[(N[(N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision] * c), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
2 \cdot \left(\left(x \cdot y + z \cdot t\right) - \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i\right)
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 12 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a b c i) :precision binary64 (* 2.0 (- (+ (* x y) (* z t)) (* (* (+ a (* b c)) c) i))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return 2.0 * (((x * y) + (z * t)) - (((a + (b * c)) * c) * i));
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
code = 2.0d0 * (((x * y) + (z * t)) - (((a + (b * c)) * c) * i))
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return 2.0 * (((x * y) + (z * t)) - (((a + (b * c)) * c) * i));
}
def code(x, y, z, t, a, b, c, i): return 2.0 * (((x * y) + (z * t)) - (((a + (b * c)) * c) * i))
function code(x, y, z, t, a, b, c, i) return Float64(2.0 * Float64(Float64(Float64(x * y) + Float64(z * t)) - Float64(Float64(Float64(a + Float64(b * c)) * c) * i))) end
function tmp = code(x, y, z, t, a, b, c, i) tmp = 2.0 * (((x * y) + (z * t)) - (((a + (b * c)) * c) * i)); end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(2.0 * N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] - N[(N[(N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision] * c), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
2 \cdot \left(\left(x \cdot y + z \cdot t\right) - \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i\right)
\end{array}
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ a (* b c))))
(if (<= (- (+ (* 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 * 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]}, 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 \left(-i\right)\right)\right)\\
\end{array}
\end{array}
if (-.f64 (+.f64 (*.f64 x y) (*.f64 z t)) (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i)) < +inf.0Initial program 95.4%
fma-def95.4%
associate-*l*98.4%
Simplified98.4%
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 70.1%
Final simplification97.3%
(FPCore (x y z t a b c i) :precision binary64 (let* ((t_1 (+ a (* b c))) (t_2 (- (+ (* x y) (* z t)) (* (* c t_1) i)))) (if (<= t_2 INFINITY) (* t_2 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 t_2 = ((x * y) + (z * t)) - ((c * t_1) * i);
double tmp;
if (t_2 <= ((double) INFINITY)) {
tmp = t_2 * 2.0;
} else {
tmp = 2.0 * (c * (t_1 * -i));
}
return tmp;
}
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = a + (b * c);
double t_2 = ((x * y) + (z * t)) - ((c * t_1) * i);
double tmp;
if (t_2 <= Double.POSITIVE_INFINITY) {
tmp = t_2 * 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) t_2 = ((x * y) + (z * t)) - ((c * t_1) * i) tmp = 0 if t_2 <= math.inf: tmp = t_2 * 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)) t_2 = Float64(Float64(Float64(x * y) + Float64(z * t)) - Float64(Float64(c * t_1) * i)) tmp = 0.0 if (t_2 <= Inf) tmp = Float64(t_2 * 2.0); else tmp = Float64(2.0 * Float64(c * Float64(t_1 * Float64(-i)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = a + (b * c); t_2 = ((x * y) + (z * t)) - ((c * t_1) * i); tmp = 0.0; if (t_2 <= Inf) tmp = t_2 * 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]}, Block[{t$95$2 = N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] - N[(N[(c * t$95$1), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, Infinity], N[(t$95$2 * 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\\
t_2 := \left(x \cdot y + z \cdot t\right) - \left(c \cdot t_1\right) \cdot i\\
\mathbf{if}\;t_2 \leq \infty:\\
\;\;\;\;t_2 \cdot 2\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(c \cdot \left(t_1 \cdot \left(-i\right)\right)\right)\\
\end{array}
\end{array}
if (-.f64 (+.f64 (*.f64 x y) (*.f64 z t)) (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i)) < +inf.0Initial program 95.4%
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 70.1%
Final simplification94.4%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= a -2.55e+119) (not (<= a 6e+28))) (* 2.0 (- (+ (* x y) (* z t)) (* i (* a c)))) (* 2.0 (+ (* z t) (- (* x y) (* (* b c) (* c i)))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((a <= -2.55e+119) || !(a <= 6e+28)) {
tmp = 2.0 * (((x * y) + (z * t)) - (i * (a * c)));
} else {
tmp = 2.0 * ((z * t) + ((x * y) - ((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) :: tmp
if ((a <= (-2.55d+119)) .or. (.not. (a <= 6d+28))) then
tmp = 2.0d0 * (((x * y) + (z * t)) - (i * (a * c)))
else
tmp = 2.0d0 * ((z * t) + ((x * y) - ((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 tmp;
if ((a <= -2.55e+119) || !(a <= 6e+28)) {
tmp = 2.0 * (((x * y) + (z * t)) - (i * (a * c)));
} else {
tmp = 2.0 * ((z * t) + ((x * y) - ((b * c) * (c * i))));
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if (a <= -2.55e+119) or not (a <= 6e+28): tmp = 2.0 * (((x * y) + (z * t)) - (i * (a * c))) else: tmp = 2.0 * ((z * t) + ((x * y) - ((b * c) * (c * i)))) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if ((a <= -2.55e+119) || !(a <= 6e+28)) tmp = Float64(2.0 * Float64(Float64(Float64(x * y) + Float64(z * t)) - Float64(i * Float64(a * c)))); else tmp = Float64(2.0 * Float64(Float64(z * t) + Float64(Float64(x * y) - Float64(Float64(b * c) * Float64(c * i))))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if ((a <= -2.55e+119) || ~((a <= 6e+28))) tmp = 2.0 * (((x * y) + (z * t)) - (i * (a * c))); else tmp = 2.0 * ((z * t) + ((x * y) - ((b * c) * (c * i)))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[a, -2.55e+119], N[Not[LessEqual[a, 6e+28]], $MachinePrecision]], N[(2.0 * N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] - N[(i * N[(a * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[(z * t), $MachinePrecision] + N[(N[(x * y), $MachinePrecision] - N[(N[(b * c), $MachinePrecision] * N[(c * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -2.55 \cdot 10^{+119} \lor \neg \left(a \leq 6 \cdot 10^{+28}\right):\\
\;\;\;\;2 \cdot \left(\left(x \cdot y + z \cdot t\right) - i \cdot \left(a \cdot c\right)\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(z \cdot t + \left(x \cdot y - \left(b \cdot c\right) \cdot \left(c \cdot i\right)\right)\right)\\
\end{array}
\end{array}
if a < -2.54999999999999992e119 or 6.0000000000000002e28 < a Initial program 92.2%
Taylor expanded in a around inf 84.6%
*-commutative84.6%
Simplified84.6%
if -2.54999999999999992e119 < a < 6.0000000000000002e28Initial program 91.3%
associate--l+91.3%
*-commutative91.3%
associate--l+91.3%
associate--l+91.3%
*-commutative91.3%
associate--l+91.3%
fma-def91.3%
*-commutative91.3%
associate-*l*95.8%
+-commutative95.8%
fma-def95.8%
Simplified95.8%
Taylor expanded in b around inf 93.4%
fma-def93.4%
+-commutative93.4%
associate--l+93.4%
*-commutative93.4%
*-commutative93.4%
associate-*l*92.3%
Applied egg-rr92.3%
Final simplification89.6%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ (* x y) (* z t))))
(if (or (<= a -1.8e+123) (not (<= a 4.9e+29)))
(* 2.0 (- t_1 (* i (* a c))))
(* 2.0 (- t_1 (* c (* b (* c i))))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = (x * y) + (z * t);
double tmp;
if ((a <= -1.8e+123) || !(a <= 4.9e+29)) {
tmp = 2.0 * (t_1 - (i * (a * c)));
} else {
tmp = 2.0 * (t_1 - (c * (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) :: t_1
real(8) :: tmp
t_1 = (x * y) + (z * t)
if ((a <= (-1.8d+123)) .or. (.not. (a <= 4.9d+29))) then
tmp = 2.0d0 * (t_1 - (i * (a * c)))
else
tmp = 2.0d0 * (t_1 - (c * (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 t_1 = (x * y) + (z * t);
double tmp;
if ((a <= -1.8e+123) || !(a <= 4.9e+29)) {
tmp = 2.0 * (t_1 - (i * (a * c)));
} else {
tmp = 2.0 * (t_1 - (c * (b * (c * i))));
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = (x * y) + (z * t) tmp = 0 if (a <= -1.8e+123) or not (a <= 4.9e+29): tmp = 2.0 * (t_1 - (i * (a * c))) else: tmp = 2.0 * (t_1 - (c * (b * (c * i)))) return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(Float64(x * y) + Float64(z * t)) tmp = 0.0 if ((a <= -1.8e+123) || !(a <= 4.9e+29)) tmp = Float64(2.0 * Float64(t_1 - Float64(i * Float64(a * c)))); else tmp = Float64(2.0 * Float64(t_1 - Float64(c * Float64(b * Float64(c * i))))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = (x * y) + (z * t); tmp = 0.0; if ((a <= -1.8e+123) || ~((a <= 4.9e+29))) tmp = 2.0 * (t_1 - (i * (a * c))); else tmp = 2.0 * (t_1 - (c * (b * (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[Or[LessEqual[a, -1.8e+123], N[Not[LessEqual[a, 4.9e+29]], $MachinePrecision]], N[(2.0 * N[(t$95$1 - N[(i * N[(a * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(t$95$1 - N[(c * N[(b * N[(c * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot y + z \cdot t\\
\mathbf{if}\;a \leq -1.8 \cdot 10^{+123} \lor \neg \left(a \leq 4.9 \cdot 10^{+29}\right):\\
\;\;\;\;2 \cdot \left(t_1 - i \cdot \left(a \cdot c\right)\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(t_1 - c \cdot \left(b \cdot \left(c \cdot i\right)\right)\right)\\
\end{array}
\end{array}
if a < -1.79999999999999999e123 or 4.9000000000000001e29 < a Initial program 92.2%
Taylor expanded in a around inf 84.6%
*-commutative84.6%
Simplified84.6%
if -1.79999999999999999e123 < a < 4.9000000000000001e29Initial program 91.3%
associate--l+91.3%
*-commutative91.3%
associate--l+91.3%
associate--l+91.3%
*-commutative91.3%
associate--l+91.3%
fma-def91.3%
*-commutative91.3%
associate-*l*95.8%
+-commutative95.8%
fma-def95.8%
Simplified95.8%
Taylor expanded in b around inf 93.4%
fma-def93.4%
+-commutative93.4%
Applied egg-rr93.4%
Final simplification90.3%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= c -4.2e+132) (not (<= c 7e+135))) (* 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 <= -4.2e+132) || !(c <= 7e+135)) {
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 <= (-4.2d+132)) .or. (.not. (c <= 7d+135))) 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 <= -4.2e+132) || !(c <= 7e+135)) {
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 <= -4.2e+132) or not (c <= 7e+135): 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 <= -4.2e+132) || !(c <= 7e+135)) 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 <= -4.2e+132) || ~((c <= 7e+135))) 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, -4.2e+132], N[Not[LessEqual[c, 7e+135]], $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 -4.2 \cdot 10^{+132} \lor \neg \left(c \leq 7 \cdot 10^{+135}\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 < -4.19999999999999987e132 or 7.0000000000000005e135 < c Initial program 80.4%
Taylor expanded in i around inf 83.6%
if -4.19999999999999987e132 < c < 7.0000000000000005e135Initial program 97.5%
Taylor expanded in a around inf 88.4%
*-commutative88.4%
Simplified88.4%
Final simplification86.7%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= c -2.05e+100) (not (<= c 3.6e+15))) (* 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 <= -2.05e+100) || !(c <= 3.6e+15)) {
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 <= (-2.05d+100)) .or. (.not. (c <= 3.6d+15))) 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 <= -2.05e+100) || !(c <= 3.6e+15)) {
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 <= -2.05e+100) or not (c <= 3.6e+15): 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 <= -2.05e+100) || !(c <= 3.6e+15)) tmp = Float64(2.0 * Float64(c * Float64(Float64(a + Float64(b * c)) * Float64(-i)))); else tmp = Float64(Float64(Float64(x * y) + Float64(z * t)) * 2.0); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if ((c <= -2.05e+100) || ~((c <= 3.6e+15))) 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, -2.05e+100], N[Not[LessEqual[c, 3.6e+15]], $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 -2.05 \cdot 10^{+100} \lor \neg \left(c \leq 3.6 \cdot 10^{+15}\right):\\
\;\;\;\;2 \cdot \left(c \cdot \left(\left(a + b \cdot c\right) \cdot \left(-i\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(x \cdot y + z \cdot t\right) \cdot 2\\
\end{array}
\end{array}
if c < -2.0500000000000001e100 or 3.6e15 < c Initial program 82.1%
Taylor expanded in i around inf 80.3%
if -2.0500000000000001e100 < c < 3.6e15Initial program 99.2%
Taylor expanded in c around 0 79.6%
Final simplification79.9%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= c -1.5e+132) (not (<= c 4.2e+99))) (* 2.0 (* c (* (* c i) (- b)))) (* (+ (* x y) (* z t)) 2.0)))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((c <= -1.5e+132) || !(c <= 4.2e+99)) {
tmp = 2.0 * (c * ((c * i) * -b));
} else {
tmp = ((x * y) + (z * t)) * 2.0;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: tmp
if ((c <= (-1.5d+132)) .or. (.not. (c <= 4.2d+99))) then
tmp = 2.0d0 * (c * ((c * i) * -b))
else
tmp = ((x * y) + (z * t)) * 2.0d0
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((c <= -1.5e+132) || !(c <= 4.2e+99)) {
tmp = 2.0 * (c * ((c * i) * -b));
} else {
tmp = ((x * y) + (z * t)) * 2.0;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if (c <= -1.5e+132) or not (c <= 4.2e+99): tmp = 2.0 * (c * ((c * i) * -b)) else: tmp = ((x * y) + (z * t)) * 2.0 return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if ((c <= -1.5e+132) || !(c <= 4.2e+99)) tmp = Float64(2.0 * Float64(c * Float64(Float64(c * i) * Float64(-b)))); else tmp = Float64(Float64(Float64(x * y) + Float64(z * t)) * 2.0); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if ((c <= -1.5e+132) || ~((c <= 4.2e+99))) tmp = 2.0 * (c * ((c * i) * -b)); else tmp = ((x * y) + (z * t)) * 2.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[c, -1.5e+132], N[Not[LessEqual[c, 4.2e+99]], $MachinePrecision]], N[(2.0 * N[(c * N[(N[(c * i), $MachinePrecision] * (-b)), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;c \leq -1.5 \cdot 10^{+132} \lor \neg \left(c \leq 4.2 \cdot 10^{+99}\right):\\
\;\;\;\;2 \cdot \left(c \cdot \left(\left(c \cdot i\right) \cdot \left(-b\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(x \cdot y + z \cdot t\right) \cdot 2\\
\end{array}
\end{array}
if c < -1.4999999999999999e132 or 4.2000000000000002e99 < c Initial program 82.2%
Taylor expanded in i around inf 82.0%
Taylor expanded in a around 0 73.8%
if -1.4999999999999999e132 < c < 4.2000000000000002e99Initial program 97.4%
Taylor expanded in c around 0 74.9%
Final simplification74.5%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* (* x y) 2.0)) (t_2 (* (* z t) 2.0)))
(if (<= z -2.7e+170)
t_2
(if (<= z -1.46e-15)
t_1
(if (<= z -5e-107)
(* i (* (* a c) -2.0))
(if (<= z 2.85e-30) 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 = (x * y) * 2.0;
double t_2 = (z * t) * 2.0;
double tmp;
if (z <= -2.7e+170) {
tmp = t_2;
} else if (z <= -1.46e-15) {
tmp = t_1;
} else if (z <= -5e-107) {
tmp = i * ((a * c) * -2.0);
} else if (z <= 2.85e-30) {
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 = (x * y) * 2.0d0
t_2 = (z * t) * 2.0d0
if (z <= (-2.7d+170)) then
tmp = t_2
else if (z <= (-1.46d-15)) then
tmp = t_1
else if (z <= (-5d-107)) then
tmp = i * ((a * c) * (-2.0d0))
else if (z <= 2.85d-30) 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 = (x * y) * 2.0;
double t_2 = (z * t) * 2.0;
double tmp;
if (z <= -2.7e+170) {
tmp = t_2;
} else if (z <= -1.46e-15) {
tmp = t_1;
} else if (z <= -5e-107) {
tmp = i * ((a * c) * -2.0);
} else if (z <= 2.85e-30) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = (x * y) * 2.0 t_2 = (z * t) * 2.0 tmp = 0 if z <= -2.7e+170: tmp = t_2 elif z <= -1.46e-15: tmp = t_1 elif z <= -5e-107: tmp = i * ((a * c) * -2.0) elif z <= 2.85e-30: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(Float64(x * y) * 2.0) t_2 = Float64(Float64(z * t) * 2.0) tmp = 0.0 if (z <= -2.7e+170) tmp = t_2; elseif (z <= -1.46e-15) tmp = t_1; elseif (z <= -5e-107) tmp = Float64(i * Float64(Float64(a * c) * -2.0)); elseif (z <= 2.85e-30) 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 = (x * y) * 2.0; t_2 = (z * t) * 2.0; tmp = 0.0; if (z <= -2.7e+170) tmp = t_2; elseif (z <= -1.46e-15) tmp = t_1; elseif (z <= -5e-107) tmp = i * ((a * c) * -2.0); elseif (z <= 2.85e-30) tmp = t_1; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(x * y), $MachinePrecision] * 2.0), $MachinePrecision]}, Block[{t$95$2 = N[(N[(z * t), $MachinePrecision] * 2.0), $MachinePrecision]}, If[LessEqual[z, -2.7e+170], t$95$2, If[LessEqual[z, -1.46e-15], t$95$1, If[LessEqual[z, -5e-107], N[(i * N[(N[(a * c), $MachinePrecision] * -2.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2.85e-30], t$95$1, t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(x \cdot y\right) \cdot 2\\
t_2 := \left(z \cdot t\right) \cdot 2\\
\mathbf{if}\;z \leq -2.7 \cdot 10^{+170}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;z \leq -1.46 \cdot 10^{-15}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq -5 \cdot 10^{-107}:\\
\;\;\;\;i \cdot \left(\left(a \cdot c\right) \cdot -2\right)\\
\mathbf{elif}\;z \leq 2.85 \cdot 10^{-30}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if z < -2.7000000000000002e170 or 2.84999999999999989e-30 < z Initial program 88.9%
Taylor expanded in z around inf 43.9%
if -2.7000000000000002e170 < z < -1.4600000000000001e-15 or -4.99999999999999971e-107 < z < 2.84999999999999989e-30Initial program 92.7%
Taylor expanded in x around inf 43.0%
if -1.4600000000000001e-15 < z < -4.99999999999999971e-107Initial program 99.7%
Taylor expanded in a around inf 61.0%
mul-1-neg61.0%
*-commutative61.0%
associate-*l*48.5%
Simplified48.5%
Taylor expanded in c around 0 61.0%
*-commutative61.0%
associate-*r*60.8%
*-commutative60.8%
*-commutative60.8%
associate-*l*60.8%
Simplified60.8%
Final simplification44.4%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* (* x y) 2.0)) (t_2 (* (* z t) 2.0)))
(if (<= z -2.6e+170)
t_2
(if (<= z -118.0)
t_1
(if (<= z -2.2e-105)
(* (* c i) (* a -2.0))
(if (<= z 8e-32) 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 = (x * y) * 2.0;
double t_2 = (z * t) * 2.0;
double tmp;
if (z <= -2.6e+170) {
tmp = t_2;
} else if (z <= -118.0) {
tmp = t_1;
} else if (z <= -2.2e-105) {
tmp = (c * i) * (a * -2.0);
} else if (z <= 8e-32) {
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 = (x * y) * 2.0d0
t_2 = (z * t) * 2.0d0
if (z <= (-2.6d+170)) then
tmp = t_2
else if (z <= (-118.0d0)) then
tmp = t_1
else if (z <= (-2.2d-105)) then
tmp = (c * i) * (a * (-2.0d0))
else if (z <= 8d-32) 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 = (x * y) * 2.0;
double t_2 = (z * t) * 2.0;
double tmp;
if (z <= -2.6e+170) {
tmp = t_2;
} else if (z <= -118.0) {
tmp = t_1;
} else if (z <= -2.2e-105) {
tmp = (c * i) * (a * -2.0);
} else if (z <= 8e-32) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = (x * y) * 2.0 t_2 = (z * t) * 2.0 tmp = 0 if z <= -2.6e+170: tmp = t_2 elif z <= -118.0: tmp = t_1 elif z <= -2.2e-105: tmp = (c * i) * (a * -2.0) elif z <= 8e-32: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(Float64(x * y) * 2.0) t_2 = Float64(Float64(z * t) * 2.0) tmp = 0.0 if (z <= -2.6e+170) tmp = t_2; elseif (z <= -118.0) tmp = t_1; elseif (z <= -2.2e-105) tmp = Float64(Float64(c * i) * Float64(a * -2.0)); elseif (z <= 8e-32) 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 = (x * y) * 2.0; t_2 = (z * t) * 2.0; tmp = 0.0; if (z <= -2.6e+170) tmp = t_2; elseif (z <= -118.0) tmp = t_1; elseif (z <= -2.2e-105) tmp = (c * i) * (a * -2.0); elseif (z <= 8e-32) tmp = t_1; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(x * y), $MachinePrecision] * 2.0), $MachinePrecision]}, Block[{t$95$2 = N[(N[(z * t), $MachinePrecision] * 2.0), $MachinePrecision]}, If[LessEqual[z, -2.6e+170], t$95$2, If[LessEqual[z, -118.0], t$95$1, If[LessEqual[z, -2.2e-105], N[(N[(c * i), $MachinePrecision] * N[(a * -2.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 8e-32], t$95$1, t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(x \cdot y\right) \cdot 2\\
t_2 := \left(z \cdot t\right) \cdot 2\\
\mathbf{if}\;z \leq -2.6 \cdot 10^{+170}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;z \leq -118:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq -2.2 \cdot 10^{-105}:\\
\;\;\;\;\left(c \cdot i\right) \cdot \left(a \cdot -2\right)\\
\mathbf{elif}\;z \leq 8 \cdot 10^{-32}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if z < -2.5999999999999998e170 or 8.00000000000000045e-32 < z Initial program 88.9%
Taylor expanded in z around inf 43.9%
if -2.5999999999999998e170 < z < -118 or -2.20000000000000004e-105 < z < 8.00000000000000045e-32Initial program 93.1%
Taylor expanded in x around inf 43.1%
if -118 < z < -2.20000000000000004e-105Initial program 95.0%
Taylor expanded in a around inf 51.0%
mul-1-neg51.0%
*-commutative51.0%
associate-*l*46.4%
Simplified46.4%
Taylor expanded in c around 0 51.0%
associate-*r*51.0%
Simplified51.0%
Final simplification44.0%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= (* x y) -5.6e-15) (not (<= (* x y) 35000.0))) (* (* x y) 2.0) (* (* 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 (((x * y) <= -5.6e-15) || !((x * y) <= 35000.0)) {
tmp = (x * y) * 2.0;
} else {
tmp = (z * t) * 2.0;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: tmp
if (((x * y) <= (-5.6d-15)) .or. (.not. ((x * y) <= 35000.0d0))) then
tmp = (x * y) * 2.0d0
else
tmp = (z * t) * 2.0d0
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (((x * y) <= -5.6e-15) || !((x * y) <= 35000.0)) {
tmp = (x * y) * 2.0;
} else {
tmp = (z * t) * 2.0;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if ((x * y) <= -5.6e-15) or not ((x * y) <= 35000.0): tmp = (x * y) * 2.0 else: tmp = (z * t) * 2.0 return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if ((Float64(x * y) <= -5.6e-15) || !(Float64(x * y) <= 35000.0)) tmp = Float64(Float64(x * y) * 2.0); else tmp = Float64(Float64(z * t) * 2.0); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if (((x * y) <= -5.6e-15) || ~(((x * y) <= 35000.0))) tmp = (x * y) * 2.0; else tmp = (z * t) * 2.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[N[(x * y), $MachinePrecision], -5.6e-15], N[Not[LessEqual[N[(x * y), $MachinePrecision], 35000.0]], $MachinePrecision]], N[(N[(x * y), $MachinePrecision] * 2.0), $MachinePrecision], N[(N[(z * t), $MachinePrecision] * 2.0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \cdot y \leq -5.6 \cdot 10^{-15} \lor \neg \left(x \cdot y \leq 35000\right):\\
\;\;\;\;\left(x \cdot y\right) \cdot 2\\
\mathbf{else}:\\
\;\;\;\;\left(z \cdot t\right) \cdot 2\\
\end{array}
\end{array}
if (*.f64 x y) < -5.60000000000000028e-15 or 35000 < (*.f64 x y) Initial program 88.4%
Taylor expanded in x around inf 53.6%
if -5.60000000000000028e-15 < (*.f64 x y) < 35000Initial program 95.7%
Taylor expanded in z around inf 37.9%
Final simplification46.7%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= i -2.6e+142) (not (<= i 1.45e+182))) (* (* c i) (* a -2.0)) (* (+ (* x y) (* z t)) 2.0)))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((i <= -2.6e+142) || !(i <= 1.45e+182)) {
tmp = (c * i) * (a * -2.0);
} else {
tmp = ((x * y) + (z * t)) * 2.0;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: tmp
if ((i <= (-2.6d+142)) .or. (.not. (i <= 1.45d+182))) then
tmp = (c * i) * (a * (-2.0d0))
else
tmp = ((x * y) + (z * t)) * 2.0d0
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((i <= -2.6e+142) || !(i <= 1.45e+182)) {
tmp = (c * i) * (a * -2.0);
} else {
tmp = ((x * y) + (z * t)) * 2.0;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if (i <= -2.6e+142) or not (i <= 1.45e+182): tmp = (c * i) * (a * -2.0) else: tmp = ((x * y) + (z * t)) * 2.0 return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if ((i <= -2.6e+142) || !(i <= 1.45e+182)) tmp = Float64(Float64(c * i) * Float64(a * -2.0)); else tmp = Float64(Float64(Float64(x * y) + Float64(z * t)) * 2.0); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if ((i <= -2.6e+142) || ~((i <= 1.45e+182))) tmp = (c * i) * (a * -2.0); else tmp = ((x * y) + (z * t)) * 2.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[i, -2.6e+142], N[Not[LessEqual[i, 1.45e+182]], $MachinePrecision]], N[(N[(c * i), $MachinePrecision] * N[(a * -2.0), $MachinePrecision]), $MachinePrecision], N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;i \leq -2.6 \cdot 10^{+142} \lor \neg \left(i \leq 1.45 \cdot 10^{+182}\right):\\
\;\;\;\;\left(c \cdot i\right) \cdot \left(a \cdot -2\right)\\
\mathbf{else}:\\
\;\;\;\;\left(x \cdot y + z \cdot t\right) \cdot 2\\
\end{array}
\end{array}
if i < -2.60000000000000021e142 or 1.4499999999999999e182 < i Initial program 94.5%
Taylor expanded in a around inf 64.8%
mul-1-neg64.8%
*-commutative64.8%
associate-*l*48.0%
Simplified48.0%
Taylor expanded in c around 0 64.8%
associate-*r*64.8%
Simplified64.8%
if -2.60000000000000021e142 < i < 1.4499999999999999e182Initial program 90.9%
Taylor expanded in c around 0 66.4%
Final simplification66.1%
(FPCore (x y z t a b c i) :precision binary64 (* (* z t) 2.0))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return (z * t) * 2.0;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
code = (z * t) * 2.0d0
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return (z * t) * 2.0;
}
def code(x, y, z, t, a, b, c, i): return (z * t) * 2.0
function code(x, y, z, t, a, b, c, i) return Float64(Float64(z * t) * 2.0) end
function tmp = code(x, y, z, t, a, b, c, i) tmp = (z * t) * 2.0; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(N[(z * t), $MachinePrecision] * 2.0), $MachinePrecision]
\begin{array}{l}
\\
\left(z \cdot t\right) \cdot 2
\end{array}
Initial program 91.7%
Taylor expanded in z around inf 25.3%
Final simplification25.3%
(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 2023318
(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))))