
(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 16 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 (* i (* c t_1))))
(if (or (<= t_2 (- INFINITY)) (not (<= t_2 5e+250)))
(* -2.0 (* c (* t_1 i)))
(* 2.0 (- (+ (* x y) (* z t)) t_2)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = a + (b * c);
double t_2 = i * (c * t_1);
double tmp;
if ((t_2 <= -((double) INFINITY)) || !(t_2 <= 5e+250)) {
tmp = -2.0 * (c * (t_1 * i));
} else {
tmp = 2.0 * (((x * y) + (z * t)) - t_2);
}
return tmp;
}
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = a + (b * c);
double t_2 = i * (c * t_1);
double tmp;
if ((t_2 <= -Double.POSITIVE_INFINITY) || !(t_2 <= 5e+250)) {
tmp = -2.0 * (c * (t_1 * i));
} else {
tmp = 2.0 * (((x * y) + (z * t)) - t_2);
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = a + (b * c) t_2 = i * (c * t_1) tmp = 0 if (t_2 <= -math.inf) or not (t_2 <= 5e+250): tmp = -2.0 * (c * (t_1 * i)) else: tmp = 2.0 * (((x * y) + (z * t)) - t_2) return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(a + Float64(b * c)) t_2 = Float64(i * Float64(c * t_1)) tmp = 0.0 if ((t_2 <= Float64(-Inf)) || !(t_2 <= 5e+250)) tmp = Float64(-2.0 * Float64(c * Float64(t_1 * i))); else tmp = Float64(2.0 * Float64(Float64(Float64(x * y) + Float64(z * t)) - t_2)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = a + (b * c); t_2 = i * (c * t_1); tmp = 0.0; if ((t_2 <= -Inf) || ~((t_2 <= 5e+250))) tmp = -2.0 * (c * (t_1 * i)); else tmp = 2.0 * (((x * y) + (z * t)) - t_2); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(i * N[(c * t$95$1), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[t$95$2, (-Infinity)], N[Not[LessEqual[t$95$2, 5e+250]], $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] - t$95$2), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a + b \cdot c\\
t_2 := i \cdot \left(c \cdot t_1\right)\\
\mathbf{if}\;t_2 \leq -\infty \lor \neg \left(t_2 \leq 5 \cdot 10^{+250}\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) - t_2\right)\\
\end{array}
\end{array}
if (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < -inf.0 or 5.0000000000000002e250 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) Initial program 81.8%
Taylor expanded in x around 0 90.8%
Taylor expanded in t around 0 93.7%
if -inf.0 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 5.0000000000000002e250Initial program 97.8%
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 91.1%
fma-def92.3%
associate-*l*94.7%
Simplified94.7%
Final simplification94.7%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* 2.0 (* z t)))
(t_2 (* -2.0 (* c (* b (* c i)))))
(t_3 (* 2.0 (* x y))))
(if (<= c -3.75e+49)
t_2
(if (<= c -5.3e-17)
(* (* c i) (* a -2.0))
(if (<= c -3.3e-59)
t_2
(if (<= c -2.95e-229)
t_3
(if (<= c 9.5e-302)
t_1
(if (<= c 8.8e-274) t_3 (if (<= c 1.6e+26) 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 * (z * t);
double t_2 = -2.0 * (c * (b * (c * i)));
double t_3 = 2.0 * (x * y);
double tmp;
if (c <= -3.75e+49) {
tmp = t_2;
} else if (c <= -5.3e-17) {
tmp = (c * i) * (a * -2.0);
} else if (c <= -3.3e-59) {
tmp = t_2;
} else if (c <= -2.95e-229) {
tmp = t_3;
} else if (c <= 9.5e-302) {
tmp = t_1;
} else if (c <= 8.8e-274) {
tmp = t_3;
} else if (c <= 1.6e+26) {
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) :: t_3
real(8) :: tmp
t_1 = 2.0d0 * (z * t)
t_2 = (-2.0d0) * (c * (b * (c * i)))
t_3 = 2.0d0 * (x * y)
if (c <= (-3.75d+49)) then
tmp = t_2
else if (c <= (-5.3d-17)) then
tmp = (c * i) * (a * (-2.0d0))
else if (c <= (-3.3d-59)) then
tmp = t_2
else if (c <= (-2.95d-229)) then
tmp = t_3
else if (c <= 9.5d-302) then
tmp = t_1
else if (c <= 8.8d-274) then
tmp = t_3
else if (c <= 1.6d+26) 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 * (z * t);
double t_2 = -2.0 * (c * (b * (c * i)));
double t_3 = 2.0 * (x * y);
double tmp;
if (c <= -3.75e+49) {
tmp = t_2;
} else if (c <= -5.3e-17) {
tmp = (c * i) * (a * -2.0);
} else if (c <= -3.3e-59) {
tmp = t_2;
} else if (c <= -2.95e-229) {
tmp = t_3;
} else if (c <= 9.5e-302) {
tmp = t_1;
} else if (c <= 8.8e-274) {
tmp = t_3;
} else if (c <= 1.6e+26) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = 2.0 * (z * t) t_2 = -2.0 * (c * (b * (c * i))) t_3 = 2.0 * (x * y) tmp = 0 if c <= -3.75e+49: tmp = t_2 elif c <= -5.3e-17: tmp = (c * i) * (a * -2.0) elif c <= -3.3e-59: tmp = t_2 elif c <= -2.95e-229: tmp = t_3 elif c <= 9.5e-302: tmp = t_1 elif c <= 8.8e-274: tmp = t_3 elif c <= 1.6e+26: 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(z * t)) t_2 = Float64(-2.0 * Float64(c * Float64(b * Float64(c * i)))) t_3 = Float64(2.0 * Float64(x * y)) tmp = 0.0 if (c <= -3.75e+49) tmp = t_2; elseif (c <= -5.3e-17) tmp = Float64(Float64(c * i) * Float64(a * -2.0)); elseif (c <= -3.3e-59) tmp = t_2; elseif (c <= -2.95e-229) tmp = t_3; elseif (c <= 9.5e-302) tmp = t_1; elseif (c <= 8.8e-274) tmp = t_3; elseif (c <= 1.6e+26) 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 * (z * t); t_2 = -2.0 * (c * (b * (c * i))); t_3 = 2.0 * (x * y); tmp = 0.0; if (c <= -3.75e+49) tmp = t_2; elseif (c <= -5.3e-17) tmp = (c * i) * (a * -2.0); elseif (c <= -3.3e-59) tmp = t_2; elseif (c <= -2.95e-229) tmp = t_3; elseif (c <= 9.5e-302) tmp = t_1; elseif (c <= 8.8e-274) tmp = t_3; elseif (c <= 1.6e+26) 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[(z * t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(-2.0 * N[(c * N[(b * N[(c * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(2.0 * N[(x * y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[c, -3.75e+49], t$95$2, If[LessEqual[c, -5.3e-17], N[(N[(c * i), $MachinePrecision] * N[(a * -2.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[c, -3.3e-59], t$95$2, If[LessEqual[c, -2.95e-229], t$95$3, If[LessEqual[c, 9.5e-302], t$95$1, If[LessEqual[c, 8.8e-274], t$95$3, If[LessEqual[c, 1.6e+26], t$95$1, t$95$2]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := 2 \cdot \left(z \cdot t\right)\\
t_2 := -2 \cdot \left(c \cdot \left(b \cdot \left(c \cdot i\right)\right)\right)\\
t_3 := 2 \cdot \left(x \cdot y\right)\\
\mathbf{if}\;c \leq -3.75 \cdot 10^{+49}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;c \leq -5.3 \cdot 10^{-17}:\\
\;\;\;\;\left(c \cdot i\right) \cdot \left(a \cdot -2\right)\\
\mathbf{elif}\;c \leq -3.3 \cdot 10^{-59}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;c \leq -2.95 \cdot 10^{-229}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;c \leq 9.5 \cdot 10^{-302}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;c \leq 8.8 \cdot 10^{-274}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;c \leq 1.6 \cdot 10^{+26}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if c < -3.7499999999999998e49 or -5.2999999999999998e-17 < c < -3.29999999999999982e-59 or 1.60000000000000014e26 < c Initial program 84.7%
Taylor expanded in x around 0 84.7%
Taylor expanded in t around 0 80.9%
Taylor expanded in a around 0 68.0%
if -3.7499999999999998e49 < c < -5.2999999999999998e-17Initial program 93.7%
Taylor expanded in a around inf 81.5%
*-commutative81.5%
Simplified81.5%
Taylor expanded in x around 0 75.1%
Taylor expanded in t around 0 51.0%
associate-*r*51.0%
*-commutative51.0%
*-commutative51.0%
Simplified51.0%
if -3.29999999999999982e-59 < c < -2.9500000000000002e-229 or 9.49999999999999991e-302 < c < 8.7999999999999998e-274Initial program 99.9%
Taylor expanded in x around inf 53.6%
if -2.9500000000000002e-229 < c < 9.49999999999999991e-302 or 8.7999999999999998e-274 < c < 1.60000000000000014e26Initial program 96.0%
Taylor expanded in z around inf 52.8%
Final simplification60.0%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* 2.0 (+ (* x y) (* z t))))
(t_2 (* 2.0 (- (* z t) (* a (* c i)))))
(t_3 (* -2.0 (* c (* (+ a (* b c)) i)))))
(if (<= c -1.8e+71)
t_3
(if (<= c -0.0001)
t_2
(if (<= c -4.2e-61)
t_3
(if (<= c 4.5e-30)
t_1
(if (<= c 7.4e+52) t_2 (if (<= c 2.1e+91) t_1 t_3))))))))
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) + (z * t));
double t_2 = 2.0 * ((z * t) - (a * (c * i)));
double t_3 = -2.0 * (c * ((a + (b * c)) * i));
double tmp;
if (c <= -1.8e+71) {
tmp = t_3;
} else if (c <= -0.0001) {
tmp = t_2;
} else if (c <= -4.2e-61) {
tmp = t_3;
} else if (c <= 4.5e-30) {
tmp = t_1;
} else if (c <= 7.4e+52) {
tmp = t_2;
} else if (c <= 2.1e+91) {
tmp = t_1;
} else {
tmp = t_3;
}
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 * ((x * y) + (z * t))
t_2 = 2.0d0 * ((z * t) - (a * (c * i)))
t_3 = (-2.0d0) * (c * ((a + (b * c)) * i))
if (c <= (-1.8d+71)) then
tmp = t_3
else if (c <= (-0.0001d0)) then
tmp = t_2
else if (c <= (-4.2d-61)) then
tmp = t_3
else if (c <= 4.5d-30) then
tmp = t_1
else if (c <= 7.4d+52) then
tmp = t_2
else if (c <= 2.1d+91) then
tmp = t_1
else
tmp = t_3
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) + (z * t));
double t_2 = 2.0 * ((z * t) - (a * (c * i)));
double t_3 = -2.0 * (c * ((a + (b * c)) * i));
double tmp;
if (c <= -1.8e+71) {
tmp = t_3;
} else if (c <= -0.0001) {
tmp = t_2;
} else if (c <= -4.2e-61) {
tmp = t_3;
} else if (c <= 4.5e-30) {
tmp = t_1;
} else if (c <= 7.4e+52) {
tmp = t_2;
} else if (c <= 2.1e+91) {
tmp = t_1;
} else {
tmp = t_3;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = 2.0 * ((x * y) + (z * t)) t_2 = 2.0 * ((z * t) - (a * (c * i))) t_3 = -2.0 * (c * ((a + (b * c)) * i)) tmp = 0 if c <= -1.8e+71: tmp = t_3 elif c <= -0.0001: tmp = t_2 elif c <= -4.2e-61: tmp = t_3 elif c <= 4.5e-30: tmp = t_1 elif c <= 7.4e+52: tmp = t_2 elif c <= 2.1e+91: tmp = t_1 else: tmp = t_3 return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(2.0 * Float64(Float64(x * y) + Float64(z * t))) t_2 = Float64(2.0 * Float64(Float64(z * t) - Float64(a * Float64(c * i)))) t_3 = Float64(-2.0 * Float64(c * Float64(Float64(a + Float64(b * c)) * i))) tmp = 0.0 if (c <= -1.8e+71) tmp = t_3; elseif (c <= -0.0001) tmp = t_2; elseif (c <= -4.2e-61) tmp = t_3; elseif (c <= 4.5e-30) tmp = t_1; elseif (c <= 7.4e+52) tmp = t_2; elseif (c <= 2.1e+91) tmp = t_1; else tmp = t_3; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = 2.0 * ((x * y) + (z * t)); t_2 = 2.0 * ((z * t) - (a * (c * i))); t_3 = -2.0 * (c * ((a + (b * c)) * i)); tmp = 0.0; if (c <= -1.8e+71) tmp = t_3; elseif (c <= -0.0001) tmp = t_2; elseif (c <= -4.2e-61) tmp = t_3; elseif (c <= 4.5e-30) tmp = t_1; elseif (c <= 7.4e+52) tmp = t_2; elseif (c <= 2.1e+91) tmp = t_1; else tmp = t_3; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(2.0 * N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(2.0 * N[(N[(z * t), $MachinePrecision] - N[(a * N[(c * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(-2.0 * N[(c * N[(N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[c, -1.8e+71], t$95$3, If[LessEqual[c, -0.0001], t$95$2, If[LessEqual[c, -4.2e-61], t$95$3, If[LessEqual[c, 4.5e-30], t$95$1, If[LessEqual[c, 7.4e+52], t$95$2, If[LessEqual[c, 2.1e+91], t$95$1, t$95$3]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := 2 \cdot \left(x \cdot y + z \cdot t\right)\\
t_2 := 2 \cdot \left(z \cdot t - a \cdot \left(c \cdot i\right)\right)\\
t_3 := -2 \cdot \left(c \cdot \left(\left(a + b \cdot c\right) \cdot i\right)\right)\\
\mathbf{if}\;c \leq -1.8 \cdot 10^{+71}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;c \leq -0.0001:\\
\;\;\;\;t_2\\
\mathbf{elif}\;c \leq -4.2 \cdot 10^{-61}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;c \leq 4.5 \cdot 10^{-30}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;c \leq 7.4 \cdot 10^{+52}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;c \leq 2.1 \cdot 10^{+91}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_3\\
\end{array}
\end{array}
if c < -1.8e71 or -1.00000000000000005e-4 < c < -4.1999999999999998e-61 or 2.10000000000000008e91 < c Initial program 85.8%
Taylor expanded in x around 0 87.8%
Taylor expanded in t around 0 88.0%
if -1.8e71 < c < -1.00000000000000005e-4 or 4.49999999999999967e-30 < c < 7.3999999999999999e52Initial program 95.0%
Taylor expanded in a around inf 83.1%
*-commutative83.1%
Simplified83.1%
Taylor expanded in x around 0 73.2%
if -4.1999999999999998e-61 < c < 4.49999999999999967e-30 or 7.3999999999999999e52 < c < 2.10000000000000008e91Initial program 94.7%
Taylor expanded in c around 0 79.5%
Final simplification82.0%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* 2.0 (+ (* x y) (* z t))))
(t_2 (* -2.0 (* c (* (+ a (* b c)) i)))))
(if (<= c -1.06e+72)
t_2
(if (<= c -8e-5)
(* 2.0 (- (* z t) (* a (* c i))))
(if (<= c -1.6e-58)
t_2
(if (<= c 4.2e-26)
t_1
(if (<= c 1.45e+85)
(* 2.0 (- (* z t) (* c (* b (* c i)))))
(if (<= c 2.2e+91) 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) + (z * t));
double t_2 = -2.0 * (c * ((a + (b * c)) * i));
double tmp;
if (c <= -1.06e+72) {
tmp = t_2;
} else if (c <= -8e-5) {
tmp = 2.0 * ((z * t) - (a * (c * i)));
} else if (c <= -1.6e-58) {
tmp = t_2;
} else if (c <= 4.2e-26) {
tmp = t_1;
} else if (c <= 1.45e+85) {
tmp = 2.0 * ((z * t) - (c * (b * (c * i))));
} else if (c <= 2.2e+91) {
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) + (z * t))
t_2 = (-2.0d0) * (c * ((a + (b * c)) * i))
if (c <= (-1.06d+72)) then
tmp = t_2
else if (c <= (-8d-5)) then
tmp = 2.0d0 * ((z * t) - (a * (c * i)))
else if (c <= (-1.6d-58)) then
tmp = t_2
else if (c <= 4.2d-26) then
tmp = t_1
else if (c <= 1.45d+85) then
tmp = 2.0d0 * ((z * t) - (c * (b * (c * i))))
else if (c <= 2.2d+91) 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) + (z * t));
double t_2 = -2.0 * (c * ((a + (b * c)) * i));
double tmp;
if (c <= -1.06e+72) {
tmp = t_2;
} else if (c <= -8e-5) {
tmp = 2.0 * ((z * t) - (a * (c * i)));
} else if (c <= -1.6e-58) {
tmp = t_2;
} else if (c <= 4.2e-26) {
tmp = t_1;
} else if (c <= 1.45e+85) {
tmp = 2.0 * ((z * t) - (c * (b * (c * i))));
} else if (c <= 2.2e+91) {
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) + (z * t)) t_2 = -2.0 * (c * ((a + (b * c)) * i)) tmp = 0 if c <= -1.06e+72: tmp = t_2 elif c <= -8e-5: tmp = 2.0 * ((z * t) - (a * (c * i))) elif c <= -1.6e-58: tmp = t_2 elif c <= 4.2e-26: tmp = t_1 elif c <= 1.45e+85: tmp = 2.0 * ((z * t) - (c * (b * (c * i)))) elif c <= 2.2e+91: 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(Float64(x * y) + Float64(z * t))) t_2 = Float64(-2.0 * Float64(c * Float64(Float64(a + Float64(b * c)) * i))) tmp = 0.0 if (c <= -1.06e+72) tmp = t_2; elseif (c <= -8e-5) tmp = Float64(2.0 * Float64(Float64(z * t) - Float64(a * Float64(c * i)))); elseif (c <= -1.6e-58) tmp = t_2; elseif (c <= 4.2e-26) tmp = t_1; elseif (c <= 1.45e+85) tmp = Float64(2.0 * Float64(Float64(z * t) - Float64(c * Float64(b * Float64(c * i))))); elseif (c <= 2.2e+91) 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) + (z * t)); t_2 = -2.0 * (c * ((a + (b * c)) * i)); tmp = 0.0; if (c <= -1.06e+72) tmp = t_2; elseif (c <= -8e-5) tmp = 2.0 * ((z * t) - (a * (c * i))); elseif (c <= -1.6e-58) tmp = t_2; elseif (c <= 4.2e-26) tmp = t_1; elseif (c <= 1.45e+85) tmp = 2.0 * ((z * t) - (c * (b * (c * i)))); elseif (c <= 2.2e+91) 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[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(-2.0 * N[(c * N[(N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[c, -1.06e+72], t$95$2, If[LessEqual[c, -8e-5], N[(2.0 * N[(N[(z * t), $MachinePrecision] - N[(a * N[(c * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[c, -1.6e-58], t$95$2, If[LessEqual[c, 4.2e-26], t$95$1, If[LessEqual[c, 1.45e+85], N[(2.0 * N[(N[(z * t), $MachinePrecision] - N[(c * N[(b * N[(c * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[c, 2.2e+91], t$95$1, t$95$2]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := 2 \cdot \left(x \cdot y + z \cdot t\right)\\
t_2 := -2 \cdot \left(c \cdot \left(\left(a + b \cdot c\right) \cdot i\right)\right)\\
\mathbf{if}\;c \leq -1.06 \cdot 10^{+72}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;c \leq -8 \cdot 10^{-5}:\\
\;\;\;\;2 \cdot \left(z \cdot t - a \cdot \left(c \cdot i\right)\right)\\
\mathbf{elif}\;c \leq -1.6 \cdot 10^{-58}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;c \leq 4.2 \cdot 10^{-26}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;c \leq 1.45 \cdot 10^{+85}:\\
\;\;\;\;2 \cdot \left(z \cdot t - c \cdot \left(b \cdot \left(c \cdot i\right)\right)\right)\\
\mathbf{elif}\;c \leq 2.2 \cdot 10^{+91}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if c < -1.06e72 or -8.00000000000000065e-5 < c < -1.6e-58 or 2.19999999999999999e91 < c Initial program 85.8%
Taylor expanded in x around 0 87.8%
Taylor expanded in t around 0 88.0%
if -1.06e72 < c < -8.00000000000000065e-5Initial program 95.4%
Taylor expanded in a around inf 86.3%
*-commutative86.3%
Simplified86.3%
Taylor expanded in x around 0 76.9%
if -1.6e-58 < c < 4.20000000000000016e-26 or 1.44999999999999999e85 < c < 2.19999999999999999e91Initial program 97.2%
Taylor expanded in c around 0 80.0%
if 4.20000000000000016e-26 < c < 1.44999999999999999e85Initial program 81.9%
Taylor expanded in x around 0 77.0%
Taylor expanded in a around 0 72.3%
Final simplification82.4%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ a (* b c))) (t_2 (+ (* x y) (* z t))))
(if (<= (- t_2 (* i (* c t_1))) INFINITY)
(* 2.0 (- t_2 (* 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 t_2 = (x * y) + (z * t);
double tmp;
if ((t_2 - (i * (c * t_1))) <= ((double) INFINITY)) {
tmp = 2.0 * (t_2 - (t_1 * (c * i)));
} 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);
double tmp;
if ((t_2 - (i * (c * t_1))) <= Double.POSITIVE_INFINITY) {
tmp = 2.0 * (t_2 - (t_1 * (c * i)));
} 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) tmp = 0 if (t_2 - (i * (c * t_1))) <= math.inf: tmp = 2.0 * (t_2 - (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)) t_2 = Float64(Float64(x * y) + Float64(z * t)) tmp = 0.0 if (Float64(t_2 - Float64(i * Float64(c * t_1))) <= Inf) tmp = Float64(2.0 * Float64(t_2 - Float64(t_1 * Float64(c * i)))); 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); t_2 = (x * y) + (z * t); tmp = 0.0; if ((t_2 - (i * (c * t_1))) <= Inf) tmp = 2.0 * (t_2 - (t_1 * (c * i))); 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[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(t$95$2 - N[(i * N[(c * t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], Infinity], N[(2.0 * N[(t$95$2 - N[(t$95$1 * N[(c * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(-2.0 * N[(c * N[(t$95$1 * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a + b \cdot c\\
t_2 := x \cdot y + z \cdot t\\
\mathbf{if}\;t_2 - i \cdot \left(c \cdot t_1\right) \leq \infty:\\
\;\;\;\;2 \cdot \left(t_2 - 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 96.8%
fma-def96.8%
associate-*l*98.1%
Simplified98.1%
fma-def98.1%
+-commutative98.1%
Applied egg-rr98.1%
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 x around 0 47.1%
Taylor expanded in t around 0 53.8%
Final simplification95.5%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* c (* (+ a (* b c)) i))))
(if (<= c -3.5e+87)
(* -2.0 t_1)
(if (or (<= c -1.6e-6) (and (not (<= c -2.4e-65)) (<= c 7.6e+96)))
(* 2.0 (- (+ (* x y) (* z t)) (* i (* a c))))
(* 2.0 (- (* z t) t_1))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = c * ((a + (b * c)) * i);
double tmp;
if (c <= -3.5e+87) {
tmp = -2.0 * t_1;
} else if ((c <= -1.6e-6) || (!(c <= -2.4e-65) && (c <= 7.6e+96))) {
tmp = 2.0 * (((x * y) + (z * t)) - (i * (a * c)));
} else {
tmp = 2.0 * ((z * t) - t_1);
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: t_1
real(8) :: tmp
t_1 = c * ((a + (b * c)) * i)
if (c <= (-3.5d+87)) then
tmp = (-2.0d0) * t_1
else if ((c <= (-1.6d-6)) .or. (.not. (c <= (-2.4d-65))) .and. (c <= 7.6d+96)) then
tmp = 2.0d0 * (((x * y) + (z * t)) - (i * (a * c)))
else
tmp = 2.0d0 * ((z * t) - t_1)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = c * ((a + (b * c)) * i);
double tmp;
if (c <= -3.5e+87) {
tmp = -2.0 * t_1;
} else if ((c <= -1.6e-6) || (!(c <= -2.4e-65) && (c <= 7.6e+96))) {
tmp = 2.0 * (((x * y) + (z * t)) - (i * (a * c)));
} else {
tmp = 2.0 * ((z * t) - t_1);
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = c * ((a + (b * c)) * i) tmp = 0 if c <= -3.5e+87: tmp = -2.0 * t_1 elif (c <= -1.6e-6) or (not (c <= -2.4e-65) and (c <= 7.6e+96)): tmp = 2.0 * (((x * y) + (z * t)) - (i * (a * c))) else: tmp = 2.0 * ((z * t) - t_1) return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(c * Float64(Float64(a + Float64(b * c)) * i)) tmp = 0.0 if (c <= -3.5e+87) tmp = Float64(-2.0 * t_1); elseif ((c <= -1.6e-6) || (!(c <= -2.4e-65) && (c <= 7.6e+96))) 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) - t_1)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = c * ((a + (b * c)) * i); tmp = 0.0; if (c <= -3.5e+87) tmp = -2.0 * t_1; elseif ((c <= -1.6e-6) || (~((c <= -2.4e-65)) && (c <= 7.6e+96))) tmp = 2.0 * (((x * y) + (z * t)) - (i * (a * c))); else tmp = 2.0 * ((z * t) - t_1); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(c * N[(N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[c, -3.5e+87], N[(-2.0 * t$95$1), $MachinePrecision], If[Or[LessEqual[c, -1.6e-6], And[N[Not[LessEqual[c, -2.4e-65]], $MachinePrecision], LessEqual[c, 7.6e+96]]], 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] - t$95$1), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := c \cdot \left(\left(a + b \cdot c\right) \cdot i\right)\\
\mathbf{if}\;c \leq -3.5 \cdot 10^{+87}:\\
\;\;\;\;-2 \cdot t_1\\
\mathbf{elif}\;c \leq -1.6 \cdot 10^{-6} \lor \neg \left(c \leq -2.4 \cdot 10^{-65}\right) \land c \leq 7.6 \cdot 10^{+96}:\\
\;\;\;\;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 - t_1\right)\\
\end{array}
\end{array}
if c < -3.49999999999999986e87Initial program 79.9%
Taylor expanded in x around 0 87.5%
Taylor expanded in t around 0 94.8%
if -3.49999999999999986e87 < c < -1.5999999999999999e-6 or -2.4000000000000002e-65 < c < 7.6000000000000003e96Initial program 94.1%
Taylor expanded in a around inf 88.5%
*-commutative88.5%
Simplified88.5%
if -1.5999999999999999e-6 < c < -2.4000000000000002e-65 or 7.6000000000000003e96 < c Initial program 90.9%
Taylor expanded in x around 0 91.0%
Final simplification90.1%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* 2.0 (* x y)))
(t_2 (* (* c i) (* a -2.0)))
(t_3 (* 2.0 (* z t))))
(if (<= c -5.5e-51)
t_2
(if (<= c -5.2e-230)
t_1
(if (<= c 6.2e-303)
t_3
(if (<= c 1.3e-274) t_1 (if (<= c 1.2e+132) t_3 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 = (c * i) * (a * -2.0);
double t_3 = 2.0 * (z * t);
double tmp;
if (c <= -5.5e-51) {
tmp = t_2;
} else if (c <= -5.2e-230) {
tmp = t_1;
} else if (c <= 6.2e-303) {
tmp = t_3;
} else if (c <= 1.3e-274) {
tmp = t_1;
} else if (c <= 1.2e+132) {
tmp = t_3;
} 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) :: t_3
real(8) :: tmp
t_1 = 2.0d0 * (x * y)
t_2 = (c * i) * (a * (-2.0d0))
t_3 = 2.0d0 * (z * t)
if (c <= (-5.5d-51)) then
tmp = t_2
else if (c <= (-5.2d-230)) then
tmp = t_1
else if (c <= 6.2d-303) then
tmp = t_3
else if (c <= 1.3d-274) then
tmp = t_1
else if (c <= 1.2d+132) then
tmp = t_3
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 = (c * i) * (a * -2.0);
double t_3 = 2.0 * (z * t);
double tmp;
if (c <= -5.5e-51) {
tmp = t_2;
} else if (c <= -5.2e-230) {
tmp = t_1;
} else if (c <= 6.2e-303) {
tmp = t_3;
} else if (c <= 1.3e-274) {
tmp = t_1;
} else if (c <= 1.2e+132) {
tmp = t_3;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = 2.0 * (x * y) t_2 = (c * i) * (a * -2.0) t_3 = 2.0 * (z * t) tmp = 0 if c <= -5.5e-51: tmp = t_2 elif c <= -5.2e-230: tmp = t_1 elif c <= 6.2e-303: tmp = t_3 elif c <= 1.3e-274: tmp = t_1 elif c <= 1.2e+132: tmp = t_3 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(Float64(c * i) * Float64(a * -2.0)) t_3 = Float64(2.0 * Float64(z * t)) tmp = 0.0 if (c <= -5.5e-51) tmp = t_2; elseif (c <= -5.2e-230) tmp = t_1; elseif (c <= 6.2e-303) tmp = t_3; elseif (c <= 1.3e-274) tmp = t_1; elseif (c <= 1.2e+132) tmp = t_3; 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 = (c * i) * (a * -2.0); t_3 = 2.0 * (z * t); tmp = 0.0; if (c <= -5.5e-51) tmp = t_2; elseif (c <= -5.2e-230) tmp = t_1; elseif (c <= 6.2e-303) tmp = t_3; elseif (c <= 1.3e-274) tmp = t_1; elseif (c <= 1.2e+132) tmp = t_3; 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[(N[(c * i), $MachinePrecision] * N[(a * -2.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(2.0 * N[(z * t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[c, -5.5e-51], t$95$2, If[LessEqual[c, -5.2e-230], t$95$1, If[LessEqual[c, 6.2e-303], t$95$3, If[LessEqual[c, 1.3e-274], t$95$1, If[LessEqual[c, 1.2e+132], t$95$3, t$95$2]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := 2 \cdot \left(x \cdot y\right)\\
t_2 := \left(c \cdot i\right) \cdot \left(a \cdot -2\right)\\
t_3 := 2 \cdot \left(z \cdot t\right)\\
\mathbf{if}\;c \leq -5.5 \cdot 10^{-51}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;c \leq -5.2 \cdot 10^{-230}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;c \leq 6.2 \cdot 10^{-303}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;c \leq 1.3 \cdot 10^{-274}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;c \leq 1.2 \cdot 10^{+132}:\\
\;\;\;\;t_3\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if c < -5.4999999999999997e-51 or 1.2000000000000001e132 < c Initial program 88.6%
Taylor expanded in a around inf 53.9%
*-commutative53.9%
Simplified53.9%
Taylor expanded in x around 0 48.2%
Taylor expanded in t around 0 41.1%
associate-*r*41.1%
*-commutative41.1%
*-commutative41.1%
Simplified41.1%
if -5.4999999999999997e-51 < c < -5.2000000000000003e-230 or 6.2000000000000002e-303 < c < 1.3e-274Initial program 99.9%
Taylor expanded in x around inf 52.3%
if -5.2000000000000003e-230 < c < 6.2000000000000002e-303 or 1.3e-274 < c < 1.2000000000000001e132Initial program 90.3%
Taylor expanded in z around inf 46.9%
Final simplification45.2%
(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 (<= c -7.5e-48)
(* (* c i) (* a -2.0))
(if (<= c -4.8e-231)
t_1
(if (<= c 2.25e-302)
t_2
(if (<= c 9e-274)
t_1
(if (<= c 6e+134) t_2 (* -2.0 (* i (* a c))))))))))
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 (c <= -7.5e-48) {
tmp = (c * i) * (a * -2.0);
} else if (c <= -4.8e-231) {
tmp = t_1;
} else if (c <= 2.25e-302) {
tmp = t_2;
} else if (c <= 9e-274) {
tmp = t_1;
} else if (c <= 6e+134) {
tmp = t_2;
} else {
tmp = -2.0 * (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) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = 2.0d0 * (x * y)
t_2 = 2.0d0 * (z * t)
if (c <= (-7.5d-48)) then
tmp = (c * i) * (a * (-2.0d0))
else if (c <= (-4.8d-231)) then
tmp = t_1
else if (c <= 2.25d-302) then
tmp = t_2
else if (c <= 9d-274) then
tmp = t_1
else if (c <= 6d+134) then
tmp = t_2
else
tmp = (-2.0d0) * (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 t_1 = 2.0 * (x * y);
double t_2 = 2.0 * (z * t);
double tmp;
if (c <= -7.5e-48) {
tmp = (c * i) * (a * -2.0);
} else if (c <= -4.8e-231) {
tmp = t_1;
} else if (c <= 2.25e-302) {
tmp = t_2;
} else if (c <= 9e-274) {
tmp = t_1;
} else if (c <= 6e+134) {
tmp = t_2;
} else {
tmp = -2.0 * (i * (a * c));
}
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 c <= -7.5e-48: tmp = (c * i) * (a * -2.0) elif c <= -4.8e-231: tmp = t_1 elif c <= 2.25e-302: tmp = t_2 elif c <= 9e-274: tmp = t_1 elif c <= 6e+134: tmp = t_2 else: tmp = -2.0 * (i * (a * c)) 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 (c <= -7.5e-48) tmp = Float64(Float64(c * i) * Float64(a * -2.0)); elseif (c <= -4.8e-231) tmp = t_1; elseif (c <= 2.25e-302) tmp = t_2; elseif (c <= 9e-274) tmp = t_1; elseif (c <= 6e+134) tmp = t_2; else tmp = Float64(-2.0 * Float64(i * Float64(a * c))); 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 (c <= -7.5e-48) tmp = (c * i) * (a * -2.0); elseif (c <= -4.8e-231) tmp = t_1; elseif (c <= 2.25e-302) tmp = t_2; elseif (c <= 9e-274) tmp = t_1; elseif (c <= 6e+134) tmp = t_2; else tmp = -2.0 * (i * (a * c)); 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[c, -7.5e-48], N[(N[(c * i), $MachinePrecision] * N[(a * -2.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[c, -4.8e-231], t$95$1, If[LessEqual[c, 2.25e-302], t$95$2, If[LessEqual[c, 9e-274], t$95$1, If[LessEqual[c, 6e+134], t$95$2, N[(-2.0 * N[(i * N[(a * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]
\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}\;c \leq -7.5 \cdot 10^{-48}:\\
\;\;\;\;\left(c \cdot i\right) \cdot \left(a \cdot -2\right)\\
\mathbf{elif}\;c \leq -4.8 \cdot 10^{-231}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;c \leq 2.25 \cdot 10^{-302}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;c \leq 9 \cdot 10^{-274}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;c \leq 6 \cdot 10^{+134}:\\
\;\;\;\;t_2\\
\mathbf{else}:\\
\;\;\;\;-2 \cdot \left(i \cdot \left(a \cdot c\right)\right)\\
\end{array}
\end{array}
if c < -7.50000000000000042e-48Initial program 88.0%
Taylor expanded in a around inf 59.5%
*-commutative59.5%
Simplified59.5%
Taylor expanded in x around 0 52.6%
Taylor expanded in t around 0 43.1%
associate-*r*43.1%
*-commutative43.1%
*-commutative43.1%
Simplified43.1%
if -7.50000000000000042e-48 < c < -4.79999999999999983e-231 or 2.25000000000000005e-302 < c < 8.99999999999999982e-274Initial program 99.9%
Taylor expanded in x around inf 52.3%
if -4.79999999999999983e-231 < c < 2.25000000000000005e-302 or 8.99999999999999982e-274 < c < 5.99999999999999993e134Initial program 90.3%
Taylor expanded in z around inf 46.9%
if 5.99999999999999993e134 < c Initial program 89.7%
fma-def89.7%
associate-*l*95.0%
Simplified95.0%
fma-def95.0%
+-commutative95.0%
Applied egg-rr95.0%
Taylor expanded in x around 0 94.8%
*-commutative94.8%
associate-*r*92.5%
+-commutative92.5%
fma-udef92.5%
cancel-sign-sub-inv92.5%
*-commutative92.5%
+-commutative92.5%
fma-def92.5%
distribute-rgt-neg-in92.5%
*-commutative92.5%
Simplified92.5%
Taylor expanded in a around inf 37.3%
*-commutative37.3%
associate-*r*41.9%
Simplified41.9%
Final simplification45.9%
(FPCore (x y z t a b c i)
:precision binary64
(if (or (<= c -3.8e+87)
(and (not (<= c -3e-7)) (or (<= c -3.6e-58) (not (<= c 3.7e+28)))))
(* -2.0 (* c (* 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 <= -3.8e+87) || (!(c <= -3e-7) && ((c <= -3.6e-58) || !(c <= 3.7e+28)))) {
tmp = -2.0 * (c * (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 <= (-3.8d+87)) .or. (.not. (c <= (-3d-7))) .and. (c <= (-3.6d-58)) .or. (.not. (c <= 3.7d+28))) then
tmp = (-2.0d0) * (c * (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 <= -3.8e+87) || (!(c <= -3e-7) && ((c <= -3.6e-58) || !(c <= 3.7e+28)))) {
tmp = -2.0 * (c * (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 <= -3.8e+87) or (not (c <= -3e-7) and ((c <= -3.6e-58) or not (c <= 3.7e+28))): tmp = -2.0 * (c * (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 <= -3.8e+87) || (!(c <= -3e-7) && ((c <= -3.6e-58) || !(c <= 3.7e+28)))) tmp = Float64(-2.0 * Float64(c * Float64(b * 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 ((c <= -3.8e+87) || (~((c <= -3e-7)) && ((c <= -3.6e-58) || ~((c <= 3.7e+28))))) tmp = -2.0 * (c * (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, -3.8e+87], And[N[Not[LessEqual[c, -3e-7]], $MachinePrecision], Or[LessEqual[c, -3.6e-58], N[Not[LessEqual[c, 3.7e+28]], $MachinePrecision]]]], N[(-2.0 * N[(c * N[(b * 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}\;c \leq -3.8 \cdot 10^{+87} \lor \neg \left(c \leq -3 \cdot 10^{-7}\right) \land \left(c \leq -3.6 \cdot 10^{-58} \lor \neg \left(c \leq 3.7 \cdot 10^{+28}\right)\right):\\
\;\;\;\;-2 \cdot \left(c \cdot \left(b \cdot \left(c \cdot i\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(x \cdot y + z \cdot t\right)\\
\end{array}
\end{array}
if c < -3.80000000000000011e87 or -2.9999999999999999e-7 < c < -3.60000000000000009e-58 or 3.6999999999999999e28 < c Initial program 83.6%
Taylor expanded in x around 0 87.1%
Taylor expanded in t around 0 85.5%
Taylor expanded in a around 0 71.0%
if -3.80000000000000011e87 < c < -2.9999999999999999e-7 or -3.60000000000000009e-58 < c < 3.6999999999999999e28Initial program 97.1%
Taylor expanded in c around 0 72.9%
Final simplification72.1%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* c (* (+ a (* b c)) i))))
(if (or (<= (* x y) -2e+101) (not (<= (* x y) 2e+129)))
(* 2.0 (- (* x y) t_1))
(* 2.0 (- (* z t) t_1)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = c * ((a + (b * c)) * i);
double tmp;
if (((x * y) <= -2e+101) || !((x * y) <= 2e+129)) {
tmp = 2.0 * ((x * y) - t_1);
} else {
tmp = 2.0 * ((z * t) - t_1);
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: t_1
real(8) :: tmp
t_1 = c * ((a + (b * c)) * i)
if (((x * y) <= (-2d+101)) .or. (.not. ((x * y) <= 2d+129))) then
tmp = 2.0d0 * ((x * y) - t_1)
else
tmp = 2.0d0 * ((z * t) - t_1)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = c * ((a + (b * c)) * i);
double tmp;
if (((x * y) <= -2e+101) || !((x * y) <= 2e+129)) {
tmp = 2.0 * ((x * y) - t_1);
} else {
tmp = 2.0 * ((z * t) - t_1);
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = c * ((a + (b * c)) * i) tmp = 0 if ((x * y) <= -2e+101) or not ((x * y) <= 2e+129): tmp = 2.0 * ((x * y) - t_1) else: tmp = 2.0 * ((z * t) - t_1) return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(c * Float64(Float64(a + Float64(b * c)) * i)) tmp = 0.0 if ((Float64(x * y) <= -2e+101) || !(Float64(x * y) <= 2e+129)) tmp = Float64(2.0 * Float64(Float64(x * y) - t_1)); else tmp = Float64(2.0 * Float64(Float64(z * t) - t_1)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = c * ((a + (b * c)) * i); tmp = 0.0; if (((x * y) <= -2e+101) || ~(((x * y) <= 2e+129))) tmp = 2.0 * ((x * y) - t_1); else tmp = 2.0 * ((z * t) - t_1); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(c * N[(N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[N[(x * y), $MachinePrecision], -2e+101], N[Not[LessEqual[N[(x * y), $MachinePrecision], 2e+129]], $MachinePrecision]], N[(2.0 * N[(N[(x * y), $MachinePrecision] - t$95$1), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[(z * t), $MachinePrecision] - t$95$1), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := c \cdot \left(\left(a + b \cdot c\right) \cdot i\right)\\
\mathbf{if}\;x \cdot y \leq -2 \cdot 10^{+101} \lor \neg \left(x \cdot y \leq 2 \cdot 10^{+129}\right):\\
\;\;\;\;2 \cdot \left(x \cdot y - t_1\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(z \cdot t - t_1\right)\\
\end{array}
\end{array}
if (*.f64 x y) < -2e101 or 2e129 < (*.f64 x y) Initial program 87.1%
Taylor expanded in z around 0 79.3%
if -2e101 < (*.f64 x y) < 2e129Initial program 93.1%
Taylor expanded in x around 0 83.8%
Final simplification82.3%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= c -4.1e-60) (not (<= c 1.5e-81))) (* 2.0 (- (* z t) (* 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 <= -4.1e-60) || !(c <= 1.5e-81)) {
tmp = 2.0 * ((z * t) - (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 <= (-4.1d-60)) .or. (.not. (c <= 1.5d-81))) then
tmp = 2.0d0 * ((z * t) - (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 <= -4.1e-60) || !(c <= 1.5e-81)) {
tmp = 2.0 * ((z * t) - (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 <= -4.1e-60) or not (c <= 1.5e-81): tmp = 2.0 * ((z * t) - (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 <= -4.1e-60) || !(c <= 1.5e-81)) tmp = Float64(2.0 * Float64(Float64(z * t) - Float64(c * Float64(Float64(a + Float64(b * c)) * i)))); else tmp = Float64(2.0 * Float64(Float64(x * y) + Float64(z * t))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if ((c <= -4.1e-60) || ~((c <= 1.5e-81))) tmp = 2.0 * ((z * t) - (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, -4.1e-60], N[Not[LessEqual[c, 1.5e-81]], $MachinePrecision]], N[(2.0 * N[(N[(z * t), $MachinePrecision] - N[(c * N[(N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;c \leq -4.1 \cdot 10^{-60} \lor \neg \left(c \leq 1.5 \cdot 10^{-81}\right):\\
\;\;\;\;2 \cdot \left(z \cdot t - c \cdot \left(\left(a + b \cdot c\right) \cdot i\right)\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(x \cdot y + z \cdot t\right)\\
\end{array}
\end{array}
if c < -4.10000000000000013e-60 or 1.4999999999999999e-81 < c Initial program 87.2%
Taylor expanded in x around 0 84.3%
if -4.10000000000000013e-60 < c < 1.4999999999999999e-81Initial program 97.8%
Taylor expanded in c around 0 81.9%
Final simplification83.4%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* 2.0 (* z t))))
(if (<= z -2.8e+85)
t_1
(if (<= z -6e-273)
(* 2.0 (* x y))
(if (<= z 1.85e-128) (* c (* i (* a -2.0))) t_1)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = 2.0 * (z * t);
double tmp;
if (z <= -2.8e+85) {
tmp = t_1;
} else if (z <= -6e-273) {
tmp = 2.0 * (x * y);
} else if (z <= 1.85e-128) {
tmp = c * (i * (a * -2.0));
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: t_1
real(8) :: tmp
t_1 = 2.0d0 * (z * t)
if (z <= (-2.8d+85)) then
tmp = t_1
else if (z <= (-6d-273)) then
tmp = 2.0d0 * (x * y)
else if (z <= 1.85d-128) then
tmp = c * (i * (a * (-2.0d0)))
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = 2.0 * (z * t);
double tmp;
if (z <= -2.8e+85) {
tmp = t_1;
} else if (z <= -6e-273) {
tmp = 2.0 * (x * y);
} else if (z <= 1.85e-128) {
tmp = c * (i * (a * -2.0));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = 2.0 * (z * t) tmp = 0 if z <= -2.8e+85: tmp = t_1 elif z <= -6e-273: tmp = 2.0 * (x * y) elif z <= 1.85e-128: tmp = c * (i * (a * -2.0)) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(2.0 * Float64(z * t)) tmp = 0.0 if (z <= -2.8e+85) tmp = t_1; elseif (z <= -6e-273) tmp = Float64(2.0 * Float64(x * y)); elseif (z <= 1.85e-128) tmp = Float64(c * Float64(i * Float64(a * -2.0))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = 2.0 * (z * t); tmp = 0.0; if (z <= -2.8e+85) tmp = t_1; elseif (z <= -6e-273) tmp = 2.0 * (x * y); elseif (z <= 1.85e-128) tmp = c * (i * (a * -2.0)); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(2.0 * N[(z * t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -2.8e+85], t$95$1, If[LessEqual[z, -6e-273], N[(2.0 * N[(x * y), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.85e-128], N[(c * N[(i * N[(a * -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := 2 \cdot \left(z \cdot t\right)\\
\mathbf{if}\;z \leq -2.8 \cdot 10^{+85}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq -6 \cdot 10^{-273}:\\
\;\;\;\;2 \cdot \left(x \cdot y\right)\\
\mathbf{elif}\;z \leq 1.85 \cdot 10^{-128}:\\
\;\;\;\;c \cdot \left(i \cdot \left(a \cdot -2\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if z < -2.7999999999999999e85 or 1.85e-128 < z Initial program 90.0%
Taylor expanded in z around inf 42.2%
if -2.7999999999999999e85 < z < -5.99999999999999975e-273Initial program 92.8%
Taylor expanded in x around inf 32.0%
if -5.99999999999999975e-273 < z < 1.85e-128Initial program 91.7%
fma-def91.7%
associate-*l*97.2%
Simplified97.2%
fma-def97.2%
+-commutative97.2%
Applied egg-rr97.2%
Taylor expanded in x around 0 75.9%
*-commutative75.9%
associate-*r*75.9%
+-commutative75.9%
fma-udef75.9%
cancel-sign-sub-inv75.9%
*-commutative75.9%
+-commutative75.9%
fma-def76.0%
distribute-rgt-neg-in76.0%
*-commutative76.0%
Simplified76.0%
Taylor expanded in a around inf 37.7%
*-commutative37.7%
*-commutative37.7%
associate-*r*37.7%
associate-*r*37.7%
Simplified37.7%
Final simplification38.3%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= c -3.6e-58) (not (<= c 2.1e+91))) (* -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 <= -3.6e-58) || !(c <= 2.1e+91)) {
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 <= (-3.6d-58)) .or. (.not. (c <= 2.1d+91))) 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 <= -3.6e-58) || !(c <= 2.1e+91)) {
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 <= -3.6e-58) or not (c <= 2.1e+91): 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 <= -3.6e-58) || !(c <= 2.1e+91)) tmp = Float64(-2.0 * Float64(c * Float64(Float64(a + Float64(b * 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 ((c <= -3.6e-58) || ~((c <= 2.1e+91))) 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, -3.6e-58], N[Not[LessEqual[c, 2.1e+91]], $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 -3.6 \cdot 10^{-58} \lor \neg \left(c \leq 2.1 \cdot 10^{+91}\right):\\
\;\;\;\;-2 \cdot \left(c \cdot \left(\left(a + b \cdot c\right) \cdot i\right)\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(x \cdot y + z \cdot t\right)\\
\end{array}
\end{array}
if c < -3.60000000000000009e-58 or 2.10000000000000008e91 < c Initial program 87.4%
Taylor expanded in x around 0 87.5%
Taylor expanded in t around 0 82.2%
if -3.60000000000000009e-58 < c < 2.10000000000000008e91Initial program 94.7%
Taylor expanded in c around 0 74.2%
Final simplification78.1%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= x -4.8e+170) (not (<= x 1.2e+19))) (* 2.0 (* x y)) (* 2.0 (* z t))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((x <= -4.8e+170) || !(x <= 1.2e+19)) {
tmp = 2.0 * (x * y);
} else {
tmp = 2.0 * (z * t);
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: tmp
if ((x <= (-4.8d+170)) .or. (.not. (x <= 1.2d+19))) then
tmp = 2.0d0 * (x * y)
else
tmp = 2.0d0 * (z * t)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((x <= -4.8e+170) || !(x <= 1.2e+19)) {
tmp = 2.0 * (x * y);
} else {
tmp = 2.0 * (z * t);
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if (x <= -4.8e+170) or not (x <= 1.2e+19): tmp = 2.0 * (x * y) else: tmp = 2.0 * (z * t) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if ((x <= -4.8e+170) || !(x <= 1.2e+19)) tmp = Float64(2.0 * Float64(x * y)); else tmp = Float64(2.0 * Float64(z * t)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if ((x <= -4.8e+170) || ~((x <= 1.2e+19))) tmp = 2.0 * (x * y); else tmp = 2.0 * (z * t); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[x, -4.8e+170], N[Not[LessEqual[x, 1.2e+19]], $MachinePrecision]], N[(2.0 * N[(x * y), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(z * t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -4.8 \cdot 10^{+170} \lor \neg \left(x \leq 1.2 \cdot 10^{+19}\right):\\
\;\;\;\;2 \cdot \left(x \cdot y\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(z \cdot t\right)\\
\end{array}
\end{array}
if x < -4.8e170 or 1.2e19 < x Initial program 86.1%
Taylor expanded in x around inf 42.7%
if -4.8e170 < x < 1.2e19Initial program 93.6%
Taylor expanded in z around inf 33.6%
Final simplification36.6%
(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.1%
Taylor expanded in z around inf 28.5%
Final simplification28.5%
(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 2024011
(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))))