
(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 18 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 (+ (* y x) (* z t))))
(if (<= (- t_2 (* i (* c t_1))) INFINITY)
(* 2.0 (- t_2 (* (* c i) t_1)))
(* 2.0 (- (* b (* i (pow c 2.0))))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = a + (b * c);
double t_2 = (y * x) + (z * t);
double tmp;
if ((t_2 - (i * (c * t_1))) <= ((double) INFINITY)) {
tmp = 2.0 * (t_2 - ((c * i) * t_1));
} else {
tmp = 2.0 * -(b * (i * pow(c, 2.0)));
}
return tmp;
}
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = a + (b * c);
double t_2 = (y * x) + (z * t);
double tmp;
if ((t_2 - (i * (c * t_1))) <= Double.POSITIVE_INFINITY) {
tmp = 2.0 * (t_2 - ((c * i) * t_1));
} else {
tmp = 2.0 * -(b * (i * Math.pow(c, 2.0)));
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = a + (b * c) t_2 = (y * x) + (z * t) tmp = 0 if (t_2 - (i * (c * t_1))) <= math.inf: tmp = 2.0 * (t_2 - ((c * i) * t_1)) else: tmp = 2.0 * -(b * (i * math.pow(c, 2.0))) return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(a + Float64(b * c)) t_2 = Float64(Float64(y * x) + 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(Float64(c * i) * t_1))); else tmp = Float64(2.0 * Float64(-Float64(b * Float64(i * (c ^ 2.0))))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = a + (b * c); t_2 = (y * x) + (z * t); tmp = 0.0; if ((t_2 - (i * (c * t_1))) <= Inf) tmp = 2.0 * (t_2 - ((c * i) * t_1)); else tmp = 2.0 * -(b * (i * (c ^ 2.0))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(y * x), $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[(N[(c * i), $MachinePrecision] * t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * (-N[(b * N[(i * N[Power[c, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision])), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a + b \cdot c\\
t_2 := y \cdot x + z \cdot t\\
\mathbf{if}\;t\_2 - i \cdot \left(c \cdot t\_1\right) \leq \infty:\\
\;\;\;\;2 \cdot \left(t\_2 - \left(c \cdot i\right) \cdot t\_1\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(-b \cdot \left(i \cdot {c}^{2}\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 92.7%
fma-define92.7%
associate-*l*98.7%
Simplified98.7%
fma-define98.7%
+-commutative98.7%
Applied egg-rr98.7%
if +inf.0 < (-.f64 (+.f64 (*.f64 x y) (*.f64 z t)) (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i)) Initial program 0.0%
Taylor expanded in b around inf 78.0%
associate-*r*78.0%
mul-1-neg78.0%
Simplified78.0%
Final simplification98.0%
(FPCore (x y z t a b c i) :precision binary64 (* 2.0 (fma y x (fma z t (* (fma b c a) (- (* c i)))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return 2.0 * fma(y, x, fma(z, t, (fma(b, c, a) * -(c * i))));
}
function code(x, y, z, t, a, b, c, i) return Float64(2.0 * fma(y, x, fma(z, t, Float64(fma(b, c, a) * Float64(-Float64(c * i)))))) end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(2.0 * N[(y * x + N[(z * t + N[(N[(b * c + a), $MachinePrecision] * (-N[(c * i), $MachinePrecision])), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
2 \cdot \mathsf{fma}\left(y, x, \mathsf{fma}\left(z, t, \mathsf{fma}\left(b, c, a\right) \cdot \left(-c \cdot i\right)\right)\right)
\end{array}
Initial program 89.5%
associate--l+89.5%
fma-neg91.4%
*-commutative91.4%
+-commutative91.4%
fma-undefine91.4%
associate-*r*93.8%
*-commutative93.8%
*-commutative93.8%
fma-define94.6%
*-commutative94.6%
associate-*r*92.2%
fma-undefine92.2%
+-commutative92.2%
*-commutative92.2%
associate-*r*98.0%
distribute-rgt-neg-in98.0%
Applied egg-rr98.0%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ a (* b c))) (t_2 (* i (* c t_1))))
(if (<= t_2 (- INFINITY))
(* 2.0 (* c (* t_1 (- i))))
(if (<= t_2 4e+291)
(* 2.0 (- (+ (* y x) (* z t)) t_2))
(* 2.0 (- (* y x) (* c (* a (+ i (/ (* c (* b i)) a))))))))))
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)) {
tmp = 2.0 * (c * (t_1 * -i));
} else if (t_2 <= 4e+291) {
tmp = 2.0 * (((y * x) + (z * t)) - t_2);
} else {
tmp = 2.0 * ((y * x) - (c * (a * (i + ((c * (b * i)) / a)))));
}
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) {
tmp = 2.0 * (c * (t_1 * -i));
} else if (t_2 <= 4e+291) {
tmp = 2.0 * (((y * x) + (z * t)) - t_2);
} else {
tmp = 2.0 * ((y * x) - (c * (a * (i + ((c * (b * i)) / a)))));
}
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: tmp = 2.0 * (c * (t_1 * -i)) elif t_2 <= 4e+291: tmp = 2.0 * (((y * x) + (z * t)) - t_2) else: tmp = 2.0 * ((y * x) - (c * (a * (i + ((c * (b * i)) / a))))) 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)) tmp = Float64(2.0 * Float64(c * Float64(t_1 * Float64(-i)))); elseif (t_2 <= 4e+291) tmp = Float64(2.0 * Float64(Float64(Float64(y * x) + Float64(z * t)) - t_2)); else tmp = Float64(2.0 * Float64(Float64(y * x) - Float64(c * Float64(a * Float64(i + Float64(Float64(c * Float64(b * i)) / a)))))); 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) tmp = 2.0 * (c * (t_1 * -i)); elseif (t_2 <= 4e+291) tmp = 2.0 * (((y * x) + (z * t)) - t_2); else tmp = 2.0 * ((y * x) - (c * (a * (i + ((c * (b * i)) / a))))); 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[LessEqual[t$95$2, (-Infinity)], N[(2.0 * N[(c * N[(t$95$1 * (-i)), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, 4e+291], N[(2.0 * N[(N[(N[(y * x), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] - t$95$2), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[(y * x), $MachinePrecision] - N[(c * N[(a * N[(i + N[(N[(c * N[(b * i), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $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:\\
\;\;\;\;2 \cdot \left(c \cdot \left(t\_1 \cdot \left(-i\right)\right)\right)\\
\mathbf{elif}\;t\_2 \leq 4 \cdot 10^{+291}:\\
\;\;\;\;2 \cdot \left(\left(y \cdot x + z \cdot t\right) - t\_2\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(y \cdot x - c \cdot \left(a \cdot \left(i + \frac{c \cdot \left(b \cdot i\right)}{a}\right)\right)\right)\\
\end{array}
\end{array}
if (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < -inf.0Initial program 76.3%
Taylor expanded in i around inf 92.9%
if -inf.0 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 3.9999999999999998e291Initial program 99.3%
if 3.9999999999999998e291 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) Initial program 72.7%
Taylor expanded in z around 0 89.1%
Taylor expanded in a around inf 87.7%
*-commutative87.7%
associate-*r*89.4%
Simplified89.4%
Final simplification96.0%
(FPCore (x y z t a b c i)
:precision binary64
(if (or (<= c -1e+55)
(not
(or (<= c -6.2e+23)
(and (not (<= c -4e-41))
(or (<= c 2.7e-106)
(and (not (<= c 2.1e-79)) (<= c 3.7e+79)))))))
(* 2.0 (* c (* (+ a (* b c)) (- i))))
(* 2.0 (+ (* y x) (* z t)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((c <= -1e+55) || !((c <= -6.2e+23) || (!(c <= -4e-41) && ((c <= 2.7e-106) || (!(c <= 2.1e-79) && (c <= 3.7e+79)))))) {
tmp = 2.0 * (c * ((a + (b * c)) * -i));
} else {
tmp = 2.0 * ((y * x) + (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 <= (-1d+55)) .or. (.not. (c <= (-6.2d+23)) .or. (.not. (c <= (-4d-41))) .and. (c <= 2.7d-106) .or. (.not. (c <= 2.1d-79)) .and. (c <= 3.7d+79))) then
tmp = 2.0d0 * (c * ((a + (b * c)) * -i))
else
tmp = 2.0d0 * ((y * x) + (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 <= -1e+55) || !((c <= -6.2e+23) || (!(c <= -4e-41) && ((c <= 2.7e-106) || (!(c <= 2.1e-79) && (c <= 3.7e+79)))))) {
tmp = 2.0 * (c * ((a + (b * c)) * -i));
} else {
tmp = 2.0 * ((y * x) + (z * t));
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if (c <= -1e+55) or not ((c <= -6.2e+23) or (not (c <= -4e-41) and ((c <= 2.7e-106) or (not (c <= 2.1e-79) and (c <= 3.7e+79))))): tmp = 2.0 * (c * ((a + (b * c)) * -i)) else: tmp = 2.0 * ((y * x) + (z * t)) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if ((c <= -1e+55) || !((c <= -6.2e+23) || (!(c <= -4e-41) && ((c <= 2.7e-106) || (!(c <= 2.1e-79) && (c <= 3.7e+79)))))) tmp = Float64(2.0 * Float64(c * Float64(Float64(a + Float64(b * c)) * Float64(-i)))); else tmp = Float64(2.0 * Float64(Float64(y * x) + Float64(z * t))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if ((c <= -1e+55) || ~(((c <= -6.2e+23) || (~((c <= -4e-41)) && ((c <= 2.7e-106) || (~((c <= 2.1e-79)) && (c <= 3.7e+79))))))) tmp = 2.0 * (c * ((a + (b * c)) * -i)); else tmp = 2.0 * ((y * x) + (z * t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[c, -1e+55], N[Not[Or[LessEqual[c, -6.2e+23], And[N[Not[LessEqual[c, -4e-41]], $MachinePrecision], Or[LessEqual[c, 2.7e-106], And[N[Not[LessEqual[c, 2.1e-79]], $MachinePrecision], LessEqual[c, 3.7e+79]]]]]], $MachinePrecision]], N[(2.0 * N[(c * N[(N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision] * (-i)), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[(y * x), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;c \leq -1 \cdot 10^{+55} \lor \neg \left(c \leq -6.2 \cdot 10^{+23} \lor \neg \left(c \leq -4 \cdot 10^{-41}\right) \land \left(c \leq 2.7 \cdot 10^{-106} \lor \neg \left(c \leq 2.1 \cdot 10^{-79}\right) \land c \leq 3.7 \cdot 10^{+79}\right)\right):\\
\;\;\;\;2 \cdot \left(c \cdot \left(\left(a + b \cdot c\right) \cdot \left(-i\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(y \cdot x + z \cdot t\right)\\
\end{array}
\end{array}
if c < -1.00000000000000001e55 or -6.19999999999999941e23 < c < -4.00000000000000002e-41 or 2.70000000000000022e-106 < c < 2.0999999999999999e-79 or 3.70000000000000009e79 < c Initial program 83.4%
Taylor expanded in i around inf 78.8%
if -1.00000000000000001e55 < c < -6.19999999999999941e23 or -4.00000000000000002e-41 < c < 2.70000000000000022e-106 or 2.0999999999999999e-79 < c < 3.70000000000000009e79Initial program 95.4%
Taylor expanded in c around 0 79.3%
Final simplification79.1%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ a (* b c))) (t_2 (+ (* y x) (* z t))))
(if (<= (- t_2 (* i (* c t_1))) INFINITY)
(* 2.0 (- t_2 (* (* c i) t_1)))
(* 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 = (y * x) + (z * t);
double tmp;
if ((t_2 - (i * (c * t_1))) <= ((double) INFINITY)) {
tmp = 2.0 * (t_2 - ((c * i) * t_1));
} 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 = (y * x) + (z * t);
double tmp;
if ((t_2 - (i * (c * t_1))) <= Double.POSITIVE_INFINITY) {
tmp = 2.0 * (t_2 - ((c * i) * t_1));
} 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 = (y * x) + (z * t) tmp = 0 if (t_2 - (i * (c * t_1))) <= math.inf: tmp = 2.0 * (t_2 - ((c * i) * t_1)) 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(y * x) + 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(Float64(c * i) * t_1))); 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 = (y * x) + (z * t); tmp = 0.0; if ((t_2 - (i * (c * t_1))) <= Inf) tmp = 2.0 * (t_2 - ((c * i) * t_1)); 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[(y * x), $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[(N[(c * i), $MachinePrecision] * t$95$1), $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 := y \cdot x + z \cdot t\\
\mathbf{if}\;t\_2 - i \cdot \left(c \cdot t\_1\right) \leq \infty:\\
\;\;\;\;2 \cdot \left(t\_2 - \left(c \cdot i\right) \cdot t\_1\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 92.7%
fma-define92.7%
associate-*l*98.7%
Simplified98.7%
fma-define98.7%
+-commutative98.7%
Applied egg-rr98.7%
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 67.3%
Final simplification97.6%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* 2.0 (- (* y x) (* c (* a i))))))
(if (<= (* z t) -1e+181)
(* 2.0 (* z t))
(if (<= (* z t) -5e+133)
t_1
(if (<= (* z t) -1e-125)
(* 2.0 (* t (+ z (/ (* y x) t))))
(if (<= (* z t) 2e-20) t_1 (* 2.0 (+ (* y x) (* z t)))))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = 2.0 * ((y * x) - (c * (a * i)));
double tmp;
if ((z * t) <= -1e+181) {
tmp = 2.0 * (z * t);
} else if ((z * t) <= -5e+133) {
tmp = t_1;
} else if ((z * t) <= -1e-125) {
tmp = 2.0 * (t * (z + ((y * x) / t)));
} else if ((z * t) <= 2e-20) {
tmp = t_1;
} else {
tmp = 2.0 * ((y * x) + (z * t));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: t_1
real(8) :: tmp
t_1 = 2.0d0 * ((y * x) - (c * (a * i)))
if ((z * t) <= (-1d+181)) then
tmp = 2.0d0 * (z * t)
else if ((z * t) <= (-5d+133)) then
tmp = t_1
else if ((z * t) <= (-1d-125)) then
tmp = 2.0d0 * (t * (z + ((y * x) / t)))
else if ((z * t) <= 2d-20) then
tmp = t_1
else
tmp = 2.0d0 * ((y * x) + (z * t))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = 2.0 * ((y * x) - (c * (a * i)));
double tmp;
if ((z * t) <= -1e+181) {
tmp = 2.0 * (z * t);
} else if ((z * t) <= -5e+133) {
tmp = t_1;
} else if ((z * t) <= -1e-125) {
tmp = 2.0 * (t * (z + ((y * x) / t)));
} else if ((z * t) <= 2e-20) {
tmp = t_1;
} else {
tmp = 2.0 * ((y * x) + (z * t));
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = 2.0 * ((y * x) - (c * (a * i))) tmp = 0 if (z * t) <= -1e+181: tmp = 2.0 * (z * t) elif (z * t) <= -5e+133: tmp = t_1 elif (z * t) <= -1e-125: tmp = 2.0 * (t * (z + ((y * x) / t))) elif (z * t) <= 2e-20: tmp = t_1 else: tmp = 2.0 * ((y * x) + (z * t)) return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(2.0 * Float64(Float64(y * x) - Float64(c * Float64(a * i)))) tmp = 0.0 if (Float64(z * t) <= -1e+181) tmp = Float64(2.0 * Float64(z * t)); elseif (Float64(z * t) <= -5e+133) tmp = t_1; elseif (Float64(z * t) <= -1e-125) tmp = Float64(2.0 * Float64(t * Float64(z + Float64(Float64(y * x) / t)))); elseif (Float64(z * t) <= 2e-20) tmp = t_1; else tmp = Float64(2.0 * Float64(Float64(y * x) + Float64(z * t))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = 2.0 * ((y * x) - (c * (a * i))); tmp = 0.0; if ((z * t) <= -1e+181) tmp = 2.0 * (z * t); elseif ((z * t) <= -5e+133) tmp = t_1; elseif ((z * t) <= -1e-125) tmp = 2.0 * (t * (z + ((y * x) / t))); elseif ((z * t) <= 2e-20) tmp = t_1; else tmp = 2.0 * ((y * x) + (z * t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(2.0 * N[(N[(y * x), $MachinePrecision] - N[(c * N[(a * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(z * t), $MachinePrecision], -1e+181], N[(2.0 * N[(z * t), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(z * t), $MachinePrecision], -5e+133], t$95$1, If[LessEqual[N[(z * t), $MachinePrecision], -1e-125], N[(2.0 * N[(t * N[(z + N[(N[(y * x), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(z * t), $MachinePrecision], 2e-20], t$95$1, N[(2.0 * N[(N[(y * x), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := 2 \cdot \left(y \cdot x - c \cdot \left(a \cdot i\right)\right)\\
\mathbf{if}\;z \cdot t \leq -1 \cdot 10^{+181}:\\
\;\;\;\;2 \cdot \left(z \cdot t\right)\\
\mathbf{elif}\;z \cdot t \leq -5 \cdot 10^{+133}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \cdot t \leq -1 \cdot 10^{-125}:\\
\;\;\;\;2 \cdot \left(t \cdot \left(z + \frac{y \cdot x}{t}\right)\right)\\
\mathbf{elif}\;z \cdot t \leq 2 \cdot 10^{-20}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(y \cdot x + z \cdot t\right)\\
\end{array}
\end{array}
if (*.f64 z t) < -9.9999999999999992e180Initial program 86.0%
Taylor expanded in z around inf 77.5%
if -9.9999999999999992e180 < (*.f64 z t) < -4.99999999999999961e133 or -1.00000000000000001e-125 < (*.f64 z t) < 1.99999999999999989e-20Initial program 92.8%
Taylor expanded in a around inf 70.5%
*-commutative70.5%
Simplified70.5%
Taylor expanded in z around 0 71.3%
associate-*r*68.0%
*-commutative68.0%
associate-*r*67.0%
Simplified67.0%
if -4.99999999999999961e133 < (*.f64 z t) < -1.00000000000000001e-125Initial program 93.3%
Taylor expanded in c around 0 53.5%
Taylor expanded in t around inf 58.1%
if 1.99999999999999989e-20 < (*.f64 z t) Initial program 84.1%
Taylor expanded in c around 0 70.3%
Final simplification67.7%
(FPCore (x y z t a b c i)
:precision binary64
(if (or (<= (* y x) -1.65e+38)
(not
(or (<= (* y x) 1e+61)
(and (not (<= (* y x) 6.2e+125)) (<= (* y x) 8e+246)))))
(* 2.0 (* y x))
(* 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 (((y * x) <= -1.65e+38) || !(((y * x) <= 1e+61) || (!((y * x) <= 6.2e+125) && ((y * x) <= 8e+246)))) {
tmp = 2.0 * (y * x);
} 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 (((y * x) <= (-1.65d+38)) .or. (.not. ((y * x) <= 1d+61) .or. (.not. ((y * x) <= 6.2d+125)) .and. ((y * x) <= 8d+246))) then
tmp = 2.0d0 * (y * x)
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 (((y * x) <= -1.65e+38) || !(((y * x) <= 1e+61) || (!((y * x) <= 6.2e+125) && ((y * x) <= 8e+246)))) {
tmp = 2.0 * (y * x);
} else {
tmp = 2.0 * (z * t);
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if ((y * x) <= -1.65e+38) or not (((y * x) <= 1e+61) or (not ((y * x) <= 6.2e+125) and ((y * x) <= 8e+246))): tmp = 2.0 * (y * x) else: tmp = 2.0 * (z * t) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if ((Float64(y * x) <= -1.65e+38) || !((Float64(y * x) <= 1e+61) || (!(Float64(y * x) <= 6.2e+125) && (Float64(y * x) <= 8e+246)))) tmp = Float64(2.0 * Float64(y * x)); 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 (((y * x) <= -1.65e+38) || ~((((y * x) <= 1e+61) || (~(((y * x) <= 6.2e+125)) && ((y * x) <= 8e+246))))) tmp = 2.0 * (y * x); else tmp = 2.0 * (z * t); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[N[(y * x), $MachinePrecision], -1.65e+38], N[Not[Or[LessEqual[N[(y * x), $MachinePrecision], 1e+61], And[N[Not[LessEqual[N[(y * x), $MachinePrecision], 6.2e+125]], $MachinePrecision], LessEqual[N[(y * x), $MachinePrecision], 8e+246]]]], $MachinePrecision]], N[(2.0 * N[(y * x), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(z * t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \cdot x \leq -1.65 \cdot 10^{+38} \lor \neg \left(y \cdot x \leq 10^{+61} \lor \neg \left(y \cdot x \leq 6.2 \cdot 10^{+125}\right) \land y \cdot x \leq 8 \cdot 10^{+246}\right):\\
\;\;\;\;2 \cdot \left(y \cdot x\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(z \cdot t\right)\\
\end{array}
\end{array}
if (*.f64 x y) < -1.65e38 or 9.99999999999999949e60 < (*.f64 x y) < 6.2e125 or 8.00000000000000055e246 < (*.f64 x y) Initial program 89.4%
Taylor expanded in x around inf 59.9%
if -1.65e38 < (*.f64 x y) < 9.99999999999999949e60 or 6.2e125 < (*.f64 x y) < 8.00000000000000055e246Initial program 89.5%
Taylor expanded in z around inf 42.6%
Final simplification48.8%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* 2.0 (- (* y x) (* c (* c (* b i)))))))
(if (<= c -2e+54)
t_1
(if (<= c 2.7e-106)
(* 2.0 (+ (* y x) (* z t)))
(if (or (<= c 1.7e-27) (not (<= c 1.5e+145)))
(* 2.0 (* c (* (+ a (* b c)) (- i))))
t_1)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = 2.0 * ((y * x) - (c * (c * (b * i))));
double tmp;
if (c <= -2e+54) {
tmp = t_1;
} else if (c <= 2.7e-106) {
tmp = 2.0 * ((y * x) + (z * t));
} else if ((c <= 1.7e-27) || !(c <= 1.5e+145)) {
tmp = 2.0 * (c * ((a + (b * c)) * -i));
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: t_1
real(8) :: tmp
t_1 = 2.0d0 * ((y * x) - (c * (c * (b * i))))
if (c <= (-2d+54)) then
tmp = t_1
else if (c <= 2.7d-106) then
tmp = 2.0d0 * ((y * x) + (z * t))
else if ((c <= 1.7d-27) .or. (.not. (c <= 1.5d+145))) then
tmp = 2.0d0 * (c * ((a + (b * c)) * -i))
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = 2.0 * ((y * x) - (c * (c * (b * i))));
double tmp;
if (c <= -2e+54) {
tmp = t_1;
} else if (c <= 2.7e-106) {
tmp = 2.0 * ((y * x) + (z * t));
} else if ((c <= 1.7e-27) || !(c <= 1.5e+145)) {
tmp = 2.0 * (c * ((a + (b * c)) * -i));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = 2.0 * ((y * x) - (c * (c * (b * i)))) tmp = 0 if c <= -2e+54: tmp = t_1 elif c <= 2.7e-106: tmp = 2.0 * ((y * x) + (z * t)) elif (c <= 1.7e-27) or not (c <= 1.5e+145): tmp = 2.0 * (c * ((a + (b * c)) * -i)) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(2.0 * Float64(Float64(y * x) - Float64(c * Float64(c * Float64(b * i))))) tmp = 0.0 if (c <= -2e+54) tmp = t_1; elseif (c <= 2.7e-106) tmp = Float64(2.0 * Float64(Float64(y * x) + Float64(z * t))); elseif ((c <= 1.7e-27) || !(c <= 1.5e+145)) tmp = Float64(2.0 * Float64(c * Float64(Float64(a + Float64(b * c)) * Float64(-i)))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = 2.0 * ((y * x) - (c * (c * (b * i)))); tmp = 0.0; if (c <= -2e+54) tmp = t_1; elseif (c <= 2.7e-106) tmp = 2.0 * ((y * x) + (z * t)); elseif ((c <= 1.7e-27) || ~((c <= 1.5e+145))) tmp = 2.0 * (c * ((a + (b * c)) * -i)); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(2.0 * N[(N[(y * x), $MachinePrecision] - N[(c * N[(c * N[(b * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[c, -2e+54], t$95$1, If[LessEqual[c, 2.7e-106], N[(2.0 * N[(N[(y * x), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[c, 1.7e-27], N[Not[LessEqual[c, 1.5e+145]], $MachinePrecision]], N[(2.0 * N[(c * N[(N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision] * (-i)), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := 2 \cdot \left(y \cdot x - c \cdot \left(c \cdot \left(b \cdot i\right)\right)\right)\\
\mathbf{if}\;c \leq -2 \cdot 10^{+54}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;c \leq 2.7 \cdot 10^{-106}:\\
\;\;\;\;2 \cdot \left(y \cdot x + z \cdot t\right)\\
\mathbf{elif}\;c \leq 1.7 \cdot 10^{-27} \lor \neg \left(c \leq 1.5 \cdot 10^{+145}\right):\\
\;\;\;\;2 \cdot \left(c \cdot \left(\left(a + b \cdot c\right) \cdot \left(-i\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if c < -2.0000000000000002e54 or 1.69999999999999985e-27 < c < 1.5000000000000001e145Initial program 83.3%
Taylor expanded in z around 0 83.3%
Taylor expanded in a around 0 75.4%
*-commutative75.4%
associate-*r*76.4%
Simplified76.4%
if -2.0000000000000002e54 < c < 2.70000000000000022e-106Initial program 97.1%
Taylor expanded in c around 0 80.7%
if 2.70000000000000022e-106 < c < 1.69999999999999985e-27 or 1.5000000000000001e145 < c Initial program 86.0%
Taylor expanded in i around inf 77.4%
Final simplification78.3%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* 2.0 (- (* y x) (* c (* b (* c i)))))))
(if (<= c -1.5e+55)
t_1
(if (<= c 2.7e-106)
(* 2.0 (+ (* y x) (* z t)))
(if (or (<= c 5.6e-28) (not (<= c 8.6e+144)))
(* 2.0 (* c (* (+ a (* b c)) (- i))))
t_1)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = 2.0 * ((y * x) - (c * (b * (c * i))));
double tmp;
if (c <= -1.5e+55) {
tmp = t_1;
} else if (c <= 2.7e-106) {
tmp = 2.0 * ((y * x) + (z * t));
} else if ((c <= 5.6e-28) || !(c <= 8.6e+144)) {
tmp = 2.0 * (c * ((a + (b * c)) * -i));
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: t_1
real(8) :: tmp
t_1 = 2.0d0 * ((y * x) - (c * (b * (c * i))))
if (c <= (-1.5d+55)) then
tmp = t_1
else if (c <= 2.7d-106) then
tmp = 2.0d0 * ((y * x) + (z * t))
else if ((c <= 5.6d-28) .or. (.not. (c <= 8.6d+144))) then
tmp = 2.0d0 * (c * ((a + (b * c)) * -i))
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = 2.0 * ((y * x) - (c * (b * (c * i))));
double tmp;
if (c <= -1.5e+55) {
tmp = t_1;
} else if (c <= 2.7e-106) {
tmp = 2.0 * ((y * x) + (z * t));
} else if ((c <= 5.6e-28) || !(c <= 8.6e+144)) {
tmp = 2.0 * (c * ((a + (b * c)) * -i));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = 2.0 * ((y * x) - (c * (b * (c * i)))) tmp = 0 if c <= -1.5e+55: tmp = t_1 elif c <= 2.7e-106: tmp = 2.0 * ((y * x) + (z * t)) elif (c <= 5.6e-28) or not (c <= 8.6e+144): tmp = 2.0 * (c * ((a + (b * c)) * -i)) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(2.0 * Float64(Float64(y * x) - Float64(c * Float64(b * Float64(c * i))))) tmp = 0.0 if (c <= -1.5e+55) tmp = t_1; elseif (c <= 2.7e-106) tmp = Float64(2.0 * Float64(Float64(y * x) + Float64(z * t))); elseif ((c <= 5.6e-28) || !(c <= 8.6e+144)) tmp = Float64(2.0 * Float64(c * Float64(Float64(a + Float64(b * c)) * Float64(-i)))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = 2.0 * ((y * x) - (c * (b * (c * i)))); tmp = 0.0; if (c <= -1.5e+55) tmp = t_1; elseif (c <= 2.7e-106) tmp = 2.0 * ((y * x) + (z * t)); elseif ((c <= 5.6e-28) || ~((c <= 8.6e+144))) tmp = 2.0 * (c * ((a + (b * c)) * -i)); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(2.0 * N[(N[(y * x), $MachinePrecision] - N[(c * N[(b * N[(c * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[c, -1.5e+55], t$95$1, If[LessEqual[c, 2.7e-106], N[(2.0 * N[(N[(y * x), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[c, 5.6e-28], N[Not[LessEqual[c, 8.6e+144]], $MachinePrecision]], N[(2.0 * N[(c * N[(N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision] * (-i)), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := 2 \cdot \left(y \cdot x - c \cdot \left(b \cdot \left(c \cdot i\right)\right)\right)\\
\mathbf{if}\;c \leq -1.5 \cdot 10^{+55}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;c \leq 2.7 \cdot 10^{-106}:\\
\;\;\;\;2 \cdot \left(y \cdot x + z \cdot t\right)\\
\mathbf{elif}\;c \leq 5.6 \cdot 10^{-28} \lor \neg \left(c \leq 8.6 \cdot 10^{+144}\right):\\
\;\;\;\;2 \cdot \left(c \cdot \left(\left(a + b \cdot c\right) \cdot \left(-i\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if c < -1.50000000000000008e55 or 5.5999999999999996e-28 < c < 8.59999999999999968e144Initial program 83.3%
Taylor expanded in z around 0 83.3%
Taylor expanded in a around 0 75.4%
if -1.50000000000000008e55 < c < 2.70000000000000022e-106Initial program 97.1%
Taylor expanded in c around 0 80.7%
if 2.70000000000000022e-106 < c < 5.5999999999999996e-28 or 8.59999999999999968e144 < c Initial program 86.0%
Taylor expanded in i around inf 77.4%
Final simplification78.0%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= (* z t) -5e-114) (not (<= (* z t) 2e-20))) (* 2.0 (- (+ (* y x) (* z t)) (* c (* b (* c i))))) (* 2.0 (- (* y x) (* c (* i (+ a (* b c))))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (((z * t) <= -5e-114) || !((z * t) <= 2e-20)) {
tmp = 2.0 * (((y * x) + (z * t)) - (c * (b * (c * i))));
} else {
tmp = 2.0 * ((y * x) - (c * (i * (a + (b * 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 (((z * t) <= (-5d-114)) .or. (.not. ((z * t) <= 2d-20))) then
tmp = 2.0d0 * (((y * x) + (z * t)) - (c * (b * (c * i))))
else
tmp = 2.0d0 * ((y * x) - (c * (i * (a + (b * 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 (((z * t) <= -5e-114) || !((z * t) <= 2e-20)) {
tmp = 2.0 * (((y * x) + (z * t)) - (c * (b * (c * i))));
} else {
tmp = 2.0 * ((y * x) - (c * (i * (a + (b * c)))));
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if ((z * t) <= -5e-114) or not ((z * t) <= 2e-20): tmp = 2.0 * (((y * x) + (z * t)) - (c * (b * (c * i)))) else: tmp = 2.0 * ((y * x) - (c * (i * (a + (b * c))))) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if ((Float64(z * t) <= -5e-114) || !(Float64(z * t) <= 2e-20)) tmp = Float64(2.0 * Float64(Float64(Float64(y * x) + Float64(z * t)) - Float64(c * Float64(b * Float64(c * i))))); else tmp = Float64(2.0 * Float64(Float64(y * x) - Float64(c * Float64(i * Float64(a + Float64(b * c)))))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if (((z * t) <= -5e-114) || ~(((z * t) <= 2e-20))) tmp = 2.0 * (((y * x) + (z * t)) - (c * (b * (c * i)))); else tmp = 2.0 * ((y * x) - (c * (i * (a + (b * c))))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[N[(z * t), $MachinePrecision], -5e-114], N[Not[LessEqual[N[(z * t), $MachinePrecision], 2e-20]], $MachinePrecision]], N[(2.0 * N[(N[(N[(y * x), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] - N[(c * N[(b * N[(c * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[(y * x), $MachinePrecision] - N[(c * N[(i * N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \cdot t \leq -5 \cdot 10^{-114} \lor \neg \left(z \cdot t \leq 2 \cdot 10^{-20}\right):\\
\;\;\;\;2 \cdot \left(\left(y \cdot x + z \cdot t\right) - c \cdot \left(b \cdot \left(c \cdot i\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(y \cdot x - c \cdot \left(i \cdot \left(a + b \cdot c\right)\right)\right)\\
\end{array}
\end{array}
if (*.f64 z t) < -4.99999999999999989e-114 or 1.99999999999999989e-20 < (*.f64 z t) Initial program 87.1%
Taylor expanded in c around 0 89.8%
Taylor expanded in a around 0 87.9%
if -4.99999999999999989e-114 < (*.f64 z t) < 1.99999999999999989e-20Initial program 93.2%
Taylor expanded in z around 0 93.2%
Final simplification90.0%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* c (* i (+ a (* b c))))))
(if (<= (* z t) -1e+59)
(* 2.0 (- (* z t) t_1))
(if (<= (* z t) 5e+121)
(* 2.0 (- (* y x) t_1))
(* 2.0 (+ (* y x) (* z t)))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = c * (i * (a + (b * c)));
double tmp;
if ((z * t) <= -1e+59) {
tmp = 2.0 * ((z * t) - t_1);
} else if ((z * t) <= 5e+121) {
tmp = 2.0 * ((y * x) - t_1);
} else {
tmp = 2.0 * ((y * x) + (z * t));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: t_1
real(8) :: tmp
t_1 = c * (i * (a + (b * c)))
if ((z * t) <= (-1d+59)) then
tmp = 2.0d0 * ((z * t) - t_1)
else if ((z * t) <= 5d+121) then
tmp = 2.0d0 * ((y * x) - t_1)
else
tmp = 2.0d0 * ((y * x) + (z * t))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = c * (i * (a + (b * c)));
double tmp;
if ((z * t) <= -1e+59) {
tmp = 2.0 * ((z * t) - t_1);
} else if ((z * t) <= 5e+121) {
tmp = 2.0 * ((y * x) - t_1);
} else {
tmp = 2.0 * ((y * x) + (z * t));
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = c * (i * (a + (b * c))) tmp = 0 if (z * t) <= -1e+59: tmp = 2.0 * ((z * t) - t_1) elif (z * t) <= 5e+121: tmp = 2.0 * ((y * x) - t_1) else: tmp = 2.0 * ((y * x) + (z * t)) return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(c * Float64(i * Float64(a + Float64(b * c)))) tmp = 0.0 if (Float64(z * t) <= -1e+59) tmp = Float64(2.0 * Float64(Float64(z * t) - t_1)); elseif (Float64(z * t) <= 5e+121) tmp = Float64(2.0 * Float64(Float64(y * x) - t_1)); else tmp = Float64(2.0 * Float64(Float64(y * x) + Float64(z * t))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = c * (i * (a + (b * c))); tmp = 0.0; if ((z * t) <= -1e+59) tmp = 2.0 * ((z * t) - t_1); elseif ((z * t) <= 5e+121) tmp = 2.0 * ((y * x) - t_1); else tmp = 2.0 * ((y * x) + (z * t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(c * N[(i * N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(z * t), $MachinePrecision], -1e+59], N[(2.0 * N[(N[(z * t), $MachinePrecision] - t$95$1), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(z * t), $MachinePrecision], 5e+121], N[(2.0 * N[(N[(y * x), $MachinePrecision] - t$95$1), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[(y * x), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := c \cdot \left(i \cdot \left(a + b \cdot c\right)\right)\\
\mathbf{if}\;z \cdot t \leq -1 \cdot 10^{+59}:\\
\;\;\;\;2 \cdot \left(z \cdot t - t\_1\right)\\
\mathbf{elif}\;z \cdot t \leq 5 \cdot 10^{+121}:\\
\;\;\;\;2 \cdot \left(y \cdot x - t\_1\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(y \cdot x + z \cdot t\right)\\
\end{array}
\end{array}
if (*.f64 z t) < -9.99999999999999972e58Initial program 86.9%
Taylor expanded in x around 0 86.1%
if -9.99999999999999972e58 < (*.f64 z t) < 5.00000000000000007e121Initial program 92.7%
Taylor expanded in z around 0 85.2%
if 5.00000000000000007e121 < (*.f64 z t) Initial program 81.6%
Taylor expanded in c around 0 81.5%
Final simplification84.7%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* 2.0 (* y x))) (t_2 (* 2.0 (* z t))))
(if (<= t -8.5e-19)
t_2
(if (<= t -6.8e-185)
t_1
(if (<= t 1.65e-164)
(* (* c a) (* i -2.0))
(if (<= t 2.5e+23) 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 * (y * x);
double t_2 = 2.0 * (z * t);
double tmp;
if (t <= -8.5e-19) {
tmp = t_2;
} else if (t <= -6.8e-185) {
tmp = t_1;
} else if (t <= 1.65e-164) {
tmp = (c * a) * (i * -2.0);
} else if (t <= 2.5e+23) {
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 * (y * x)
t_2 = 2.0d0 * (z * t)
if (t <= (-8.5d-19)) then
tmp = t_2
else if (t <= (-6.8d-185)) then
tmp = t_1
else if (t <= 1.65d-164) then
tmp = (c * a) * (i * (-2.0d0))
else if (t <= 2.5d+23) 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 * (y * x);
double t_2 = 2.0 * (z * t);
double tmp;
if (t <= -8.5e-19) {
tmp = t_2;
} else if (t <= -6.8e-185) {
tmp = t_1;
} else if (t <= 1.65e-164) {
tmp = (c * a) * (i * -2.0);
} else if (t <= 2.5e+23) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = 2.0 * (y * x) t_2 = 2.0 * (z * t) tmp = 0 if t <= -8.5e-19: tmp = t_2 elif t <= -6.8e-185: tmp = t_1 elif t <= 1.65e-164: tmp = (c * a) * (i * -2.0) elif t <= 2.5e+23: 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(y * x)) t_2 = Float64(2.0 * Float64(z * t)) tmp = 0.0 if (t <= -8.5e-19) tmp = t_2; elseif (t <= -6.8e-185) tmp = t_1; elseif (t <= 1.65e-164) tmp = Float64(Float64(c * a) * Float64(i * -2.0)); elseif (t <= 2.5e+23) 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 * (y * x); t_2 = 2.0 * (z * t); tmp = 0.0; if (t <= -8.5e-19) tmp = t_2; elseif (t <= -6.8e-185) tmp = t_1; elseif (t <= 1.65e-164) tmp = (c * a) * (i * -2.0); elseif (t <= 2.5e+23) 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[(y * x), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(2.0 * N[(z * t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -8.5e-19], t$95$2, If[LessEqual[t, -6.8e-185], t$95$1, If[LessEqual[t, 1.65e-164], N[(N[(c * a), $MachinePrecision] * N[(i * -2.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 2.5e+23], t$95$1, t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := 2 \cdot \left(y \cdot x\right)\\
t_2 := 2 \cdot \left(z \cdot t\right)\\
\mathbf{if}\;t \leq -8.5 \cdot 10^{-19}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t \leq -6.8 \cdot 10^{-185}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 1.65 \cdot 10^{-164}:\\
\;\;\;\;\left(c \cdot a\right) \cdot \left(i \cdot -2\right)\\
\mathbf{elif}\;t \leq 2.5 \cdot 10^{+23}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if t < -8.50000000000000003e-19 or 2.5e23 < t Initial program 88.6%
Taylor expanded in z around inf 50.0%
if -8.50000000000000003e-19 < t < -6.7999999999999996e-185 or 1.65e-164 < t < 2.5e23Initial program 87.8%
Taylor expanded in x around inf 38.9%
if -6.7999999999999996e-185 < t < 1.65e-164Initial program 94.1%
Taylor expanded in a around inf 36.8%
mul-1-neg36.8%
Simplified36.8%
Taylor expanded in a around 0 36.8%
*-commutative36.8%
associate-*r*34.8%
associate-*l*34.8%
*-commutative34.8%
Simplified34.8%
Final simplification44.1%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* 2.0 (* y x))) (t_2 (* 2.0 (* z t))))
(if (<= t -9.5e-24)
t_2
(if (<= t -3.25e-186)
t_1
(if (<= t 4.8e-164)
(* (* c i) (* a -2.0))
(if (<= t 9e+22) 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 * (y * x);
double t_2 = 2.0 * (z * t);
double tmp;
if (t <= -9.5e-24) {
tmp = t_2;
} else if (t <= -3.25e-186) {
tmp = t_1;
} else if (t <= 4.8e-164) {
tmp = (c * i) * (a * -2.0);
} else if (t <= 9e+22) {
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 * (y * x)
t_2 = 2.0d0 * (z * t)
if (t <= (-9.5d-24)) then
tmp = t_2
else if (t <= (-3.25d-186)) then
tmp = t_1
else if (t <= 4.8d-164) then
tmp = (c * i) * (a * (-2.0d0))
else if (t <= 9d+22) 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 * (y * x);
double t_2 = 2.0 * (z * t);
double tmp;
if (t <= -9.5e-24) {
tmp = t_2;
} else if (t <= -3.25e-186) {
tmp = t_1;
} else if (t <= 4.8e-164) {
tmp = (c * i) * (a * -2.0);
} else if (t <= 9e+22) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = 2.0 * (y * x) t_2 = 2.0 * (z * t) tmp = 0 if t <= -9.5e-24: tmp = t_2 elif t <= -3.25e-186: tmp = t_1 elif t <= 4.8e-164: tmp = (c * i) * (a * -2.0) elif t <= 9e+22: 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(y * x)) t_2 = Float64(2.0 * Float64(z * t)) tmp = 0.0 if (t <= -9.5e-24) tmp = t_2; elseif (t <= -3.25e-186) tmp = t_1; elseif (t <= 4.8e-164) tmp = Float64(Float64(c * i) * Float64(a * -2.0)); elseif (t <= 9e+22) 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 * (y * x); t_2 = 2.0 * (z * t); tmp = 0.0; if (t <= -9.5e-24) tmp = t_2; elseif (t <= -3.25e-186) tmp = t_1; elseif (t <= 4.8e-164) tmp = (c * i) * (a * -2.0); elseif (t <= 9e+22) 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[(y * x), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(2.0 * N[(z * t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -9.5e-24], t$95$2, If[LessEqual[t, -3.25e-186], t$95$1, If[LessEqual[t, 4.8e-164], N[(N[(c * i), $MachinePrecision] * N[(a * -2.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 9e+22], t$95$1, t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := 2 \cdot \left(y \cdot x\right)\\
t_2 := 2 \cdot \left(z \cdot t\right)\\
\mathbf{if}\;t \leq -9.5 \cdot 10^{-24}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t \leq -3.25 \cdot 10^{-186}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 4.8 \cdot 10^{-164}:\\
\;\;\;\;\left(c \cdot i\right) \cdot \left(a \cdot -2\right)\\
\mathbf{elif}\;t \leq 9 \cdot 10^{+22}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if t < -9.50000000000000029e-24 or 8.9999999999999996e22 < t Initial program 88.7%
Taylor expanded in z around inf 49.7%
if -9.50000000000000029e-24 < t < -3.24999999999999981e-186 or 4.79999999999999966e-164 < t < 8.9999999999999996e22Initial program 87.7%
Taylor expanded in x around inf 39.4%
if -3.24999999999999981e-186 < t < 4.79999999999999966e-164Initial program 94.1%
Taylor expanded in a around inf 36.8%
mul-1-neg36.8%
Simplified36.8%
Taylor expanded in a around 0 36.8%
associate-*r*36.8%
Simplified36.8%
Final simplification44.4%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= c -1.1e-69) (not (<= c 8.6e-107))) (* 2.0 (- (* z t) (* c (* i (+ a (* b c)))))) (* 2.0 (+ (* y x) (* z t)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((c <= -1.1e-69) || !(c <= 8.6e-107)) {
tmp = 2.0 * ((z * t) - (c * (i * (a + (b * c)))));
} else {
tmp = 2.0 * ((y * x) + (z * t));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: tmp
if ((c <= (-1.1d-69)) .or. (.not. (c <= 8.6d-107))) then
tmp = 2.0d0 * ((z * t) - (c * (i * (a + (b * c)))))
else
tmp = 2.0d0 * ((y * x) + (z * t))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((c <= -1.1e-69) || !(c <= 8.6e-107)) {
tmp = 2.0 * ((z * t) - (c * (i * (a + (b * c)))));
} else {
tmp = 2.0 * ((y * x) + (z * t));
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if (c <= -1.1e-69) or not (c <= 8.6e-107): tmp = 2.0 * ((z * t) - (c * (i * (a + (b * c))))) else: tmp = 2.0 * ((y * x) + (z * t)) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if ((c <= -1.1e-69) || !(c <= 8.6e-107)) tmp = Float64(2.0 * Float64(Float64(z * t) - Float64(c * Float64(i * Float64(a + Float64(b * c)))))); else tmp = Float64(2.0 * Float64(Float64(y * x) + Float64(z * t))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if ((c <= -1.1e-69) || ~((c <= 8.6e-107))) tmp = 2.0 * ((z * t) - (c * (i * (a + (b * c))))); else tmp = 2.0 * ((y * x) + (z * t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[c, -1.1e-69], N[Not[LessEqual[c, 8.6e-107]], $MachinePrecision]], N[(2.0 * N[(N[(z * t), $MachinePrecision] - N[(c * N[(i * N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[(y * x), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;c \leq -1.1 \cdot 10^{-69} \lor \neg \left(c \leq 8.6 \cdot 10^{-107}\right):\\
\;\;\;\;2 \cdot \left(z \cdot t - c \cdot \left(i \cdot \left(a + b \cdot c\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(y \cdot x + z \cdot t\right)\\
\end{array}
\end{array}
if c < -1.1e-69 or 8.5999999999999995e-107 < c Initial program 85.5%
Taylor expanded in x around 0 81.8%
if -1.1e-69 < c < 8.5999999999999995e-107Initial program 97.7%
Taylor expanded in c around 0 86.1%
Final simplification83.2%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* c (* i (+ a (* b c))))))
(if (<= c -1e-68)
(* 2.0 (- (* z t) t_1))
(if (<= c 7.5e-66)
(* 2.0 (- (+ (* y x) (* z t)) (* i (* c a))))
(* 2.0 (- (* y x) t_1))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = c * (i * (a + (b * c)));
double tmp;
if (c <= -1e-68) {
tmp = 2.0 * ((z * t) - t_1);
} else if (c <= 7.5e-66) {
tmp = 2.0 * (((y * x) + (z * t)) - (i * (c * a)));
} else {
tmp = 2.0 * ((y * x) - 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 * (i * (a + (b * c)))
if (c <= (-1d-68)) then
tmp = 2.0d0 * ((z * t) - t_1)
else if (c <= 7.5d-66) then
tmp = 2.0d0 * (((y * x) + (z * t)) - (i * (c * a)))
else
tmp = 2.0d0 * ((y * x) - 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 * (i * (a + (b * c)));
double tmp;
if (c <= -1e-68) {
tmp = 2.0 * ((z * t) - t_1);
} else if (c <= 7.5e-66) {
tmp = 2.0 * (((y * x) + (z * t)) - (i * (c * a)));
} else {
tmp = 2.0 * ((y * x) - t_1);
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = c * (i * (a + (b * c))) tmp = 0 if c <= -1e-68: tmp = 2.0 * ((z * t) - t_1) elif c <= 7.5e-66: tmp = 2.0 * (((y * x) + (z * t)) - (i * (c * a))) else: tmp = 2.0 * ((y * x) - t_1) return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(c * Float64(i * Float64(a + Float64(b * c)))) tmp = 0.0 if (c <= -1e-68) tmp = Float64(2.0 * Float64(Float64(z * t) - t_1)); elseif (c <= 7.5e-66) tmp = Float64(2.0 * Float64(Float64(Float64(y * x) + Float64(z * t)) - Float64(i * Float64(c * a)))); else tmp = Float64(2.0 * Float64(Float64(y * x) - t_1)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = c * (i * (a + (b * c))); tmp = 0.0; if (c <= -1e-68) tmp = 2.0 * ((z * t) - t_1); elseif (c <= 7.5e-66) tmp = 2.0 * (((y * x) + (z * t)) - (i * (c * a))); else tmp = 2.0 * ((y * x) - t_1); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(c * N[(i * N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[c, -1e-68], N[(2.0 * N[(N[(z * t), $MachinePrecision] - t$95$1), $MachinePrecision]), $MachinePrecision], If[LessEqual[c, 7.5e-66], N[(2.0 * N[(N[(N[(y * x), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] - N[(i * N[(c * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[(y * x), $MachinePrecision] - t$95$1), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := c \cdot \left(i \cdot \left(a + b \cdot c\right)\right)\\
\mathbf{if}\;c \leq -1 \cdot 10^{-68}:\\
\;\;\;\;2 \cdot \left(z \cdot t - t\_1\right)\\
\mathbf{elif}\;c \leq 7.5 \cdot 10^{-66}:\\
\;\;\;\;2 \cdot \left(\left(y \cdot x + z \cdot t\right) - i \cdot \left(c \cdot a\right)\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(y \cdot x - t\_1\right)\\
\end{array}
\end{array}
if c < -1.00000000000000007e-68Initial program 84.5%
Taylor expanded in x around 0 86.5%
if -1.00000000000000007e-68 < c < 7.49999999999999995e-66Initial program 97.9%
Taylor expanded in a around inf 94.9%
*-commutative94.9%
Simplified94.9%
if 7.49999999999999995e-66 < c Initial program 84.5%
Taylor expanded in z around 0 83.4%
Final simplification88.6%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= t -5e-182) (not (<= t 2.1e-23))) (* 2.0 (+ (* y x) (* z t))) (* 2.0 (- (* y x) (* i (* c a))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((t <= -5e-182) || !(t <= 2.1e-23)) {
tmp = 2.0 * ((y * x) + (z * t));
} else {
tmp = 2.0 * ((y * x) - (i * (c * a)));
}
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 ((t <= (-5d-182)) .or. (.not. (t <= 2.1d-23))) then
tmp = 2.0d0 * ((y * x) + (z * t))
else
tmp = 2.0d0 * ((y * x) - (i * (c * a)))
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 ((t <= -5e-182) || !(t <= 2.1e-23)) {
tmp = 2.0 * ((y * x) + (z * t));
} else {
tmp = 2.0 * ((y * x) - (i * (c * a)));
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if (t <= -5e-182) or not (t <= 2.1e-23): tmp = 2.0 * ((y * x) + (z * t)) else: tmp = 2.0 * ((y * x) - (i * (c * a))) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if ((t <= -5e-182) || !(t <= 2.1e-23)) tmp = Float64(2.0 * Float64(Float64(y * x) + Float64(z * t))); else tmp = Float64(2.0 * Float64(Float64(y * x) - Float64(i * Float64(c * a)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if ((t <= -5e-182) || ~((t <= 2.1e-23))) tmp = 2.0 * ((y * x) + (z * t)); else tmp = 2.0 * ((y * x) - (i * (c * a))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[t, -5e-182], N[Not[LessEqual[t, 2.1e-23]], $MachinePrecision]], N[(2.0 * N[(N[(y * x), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[(y * x), $MachinePrecision] - N[(i * N[(c * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -5 \cdot 10^{-182} \lor \neg \left(t \leq 2.1 \cdot 10^{-23}\right):\\
\;\;\;\;2 \cdot \left(y \cdot x + z \cdot t\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(y \cdot x - i \cdot \left(c \cdot a\right)\right)\\
\end{array}
\end{array}
if t < -5.00000000000000024e-182 or 2.1000000000000001e-23 < t Initial program 87.9%
Taylor expanded in c around 0 57.3%
if -5.00000000000000024e-182 < t < 2.1000000000000001e-23Initial program 93.0%
Taylor expanded in a around inf 74.3%
*-commutative74.3%
Simplified74.3%
Taylor expanded in z around 0 72.7%
associate-*r*68.3%
*-commutative68.3%
associate-*r*69.3%
Simplified69.3%
Taylor expanded in x around 0 72.7%
associate-*r*68.3%
*-commutative68.3%
*-commutative68.3%
Simplified68.3%
Final simplification60.8%
(FPCore (x y z t a b c i) :precision binary64 (if (<= a -4.2e+163) (* (* c i) (* a -2.0)) (* 2.0 (+ (* y x) (* z t)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (a <= -4.2e+163) {
tmp = (c * i) * (a * -2.0);
} else {
tmp = 2.0 * ((y * x) + (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 (a <= (-4.2d+163)) then
tmp = (c * i) * (a * (-2.0d0))
else
tmp = 2.0d0 * ((y * x) + (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 (a <= -4.2e+163) {
tmp = (c * i) * (a * -2.0);
} else {
tmp = 2.0 * ((y * x) + (z * t));
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if a <= -4.2e+163: tmp = (c * i) * (a * -2.0) else: tmp = 2.0 * ((y * x) + (z * t)) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (a <= -4.2e+163) tmp = Float64(Float64(c * i) * Float64(a * -2.0)); else tmp = Float64(2.0 * Float64(Float64(y * x) + Float64(z * t))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if (a <= -4.2e+163) tmp = (c * i) * (a * -2.0); else tmp = 2.0 * ((y * x) + (z * t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[a, -4.2e+163], N[(N[(c * i), $MachinePrecision] * N[(a * -2.0), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[(y * x), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -4.2 \cdot 10^{+163}:\\
\;\;\;\;\left(c \cdot i\right) \cdot \left(a \cdot -2\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(y \cdot x + z \cdot t\right)\\
\end{array}
\end{array}
if a < -4.2000000000000001e163Initial program 90.1%
Taylor expanded in a around inf 57.5%
mul-1-neg57.5%
Simplified57.5%
Taylor expanded in a around 0 57.5%
associate-*r*57.5%
Simplified57.5%
if -4.2000000000000001e163 < a Initial program 89.4%
Taylor expanded in c around 0 58.5%
Final simplification58.3%
(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 89.5%
Taylor expanded in z around inf 31.3%
Final simplification31.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 2024086
(FPCore (x y z t a b c i)
:name "Diagrams.ThreeD.Shapes:frustum from diagrams-lib-1.3.0.3, A"
:precision binary64
:alt
(* 2.0 (- (+ (* x y) (* z t)) (* (+ a (* b c)) (* c i))))
(* 2.0 (- (+ (* x y) (* z t)) (* (* (+ a (* b c)) c) i))))