
(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 17 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a b c i) :precision binary64 (* 2.0 (- (+ (* x y) (* z t)) (* (* (+ a (* b c)) c) i))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return 2.0 * (((x * y) + (z * t)) - (((a + (b * c)) * c) * i));
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
code = 2.0d0 * (((x * y) + (z * t)) - (((a + (b * c)) * c) * i))
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return 2.0 * (((x * y) + (z * t)) - (((a + (b * c)) * c) * i));
}
def code(x, y, z, t, a, b, c, i): return 2.0 * (((x * y) + (z * t)) - (((a + (b * c)) * c) * i))
function code(x, y, z, t, a, b, c, i) return Float64(2.0 * Float64(Float64(Float64(x * y) + Float64(z * t)) - Float64(Float64(Float64(a + Float64(b * c)) * c) * i))) end
function tmp = code(x, y, z, t, a, b, c, i) tmp = 2.0 * (((x * y) + (z * t)) - (((a + (b * c)) * c) * i)); end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(2.0 * N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] - N[(N[(N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision] * c), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
2 \cdot \left(\left(x \cdot y + z \cdot t\right) - \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i\right)
\end{array}
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ a (* b c))))
(if (<= (- (+ (* z t) (* x y)) (* (* c t_1) i)) INFINITY)
(* 2.0 (- (fma x y (* z t)) (* t_1 (* c i))))
(* -2.0 (* c (* t_1 i))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = a + (b * c);
double tmp;
if ((((z * t) + (x * y)) - ((c * t_1) * i)) <= ((double) INFINITY)) {
tmp = 2.0 * (fma(x, y, (z * t)) - (t_1 * (c * i)));
} else {
tmp = -2.0 * (c * (t_1 * i));
}
return tmp;
}
function code(x, y, z, t, a, b, c, i) t_1 = Float64(a + Float64(b * c)) tmp = 0.0 if (Float64(Float64(Float64(z * t) + Float64(x * y)) - Float64(Float64(c * t_1) * i)) <= Inf) tmp = Float64(2.0 * Float64(fma(x, y, Float64(z * t)) - Float64(t_1 * Float64(c * i)))); else tmp = Float64(-2.0 * Float64(c * Float64(t_1 * i))); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(N[(N[(z * t), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision] - N[(N[(c * t$95$1), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision], Infinity], N[(2.0 * N[(N[(x * y + N[(z * t), $MachinePrecision]), $MachinePrecision] - N[(t$95$1 * N[(c * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(-2.0 * N[(c * N[(t$95$1 * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a + b \cdot c\\
\mathbf{if}\;\left(z \cdot t + x \cdot y\right) - \left(c \cdot t_1\right) \cdot i \leq \infty:\\
\;\;\;\;2 \cdot \left(\mathsf{fma}\left(x, y, z \cdot t\right) - t_1 \cdot \left(c \cdot i\right)\right)\\
\mathbf{else}:\\
\;\;\;\;-2 \cdot \left(c \cdot \left(t_1 \cdot i\right)\right)\\
\end{array}
\end{array}
if (-.f64 (+.f64 (*.f64 x y) (*.f64 z t)) (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i)) < +inf.0Initial program 96.7%
associate-*l*97.8%
fma-def97.8%
Simplified97.8%
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 62.8%
Taylor expanded in i around 0 62.8%
Final simplification95.7%
(FPCore (x y z t a b c i) :precision binary64 (let* ((t_1 (+ a (* b c))) (t_2 (- (+ (* z t) (* x y)) (* (* c t_1) i)))) (if (<= t_2 INFINITY) (* t_2 2.0) (* -2.0 (* c (* t_1 i))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = a + (b * c);
double t_2 = ((z * t) + (x * y)) - ((c * t_1) * i);
double tmp;
if (t_2 <= ((double) INFINITY)) {
tmp = t_2 * 2.0;
} else {
tmp = -2.0 * (c * (t_1 * i));
}
return tmp;
}
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = a + (b * c);
double t_2 = ((z * t) + (x * y)) - ((c * t_1) * i);
double tmp;
if (t_2 <= Double.POSITIVE_INFINITY) {
tmp = t_2 * 2.0;
} else {
tmp = -2.0 * (c * (t_1 * i));
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = a + (b * c) t_2 = ((z * t) + (x * y)) - ((c * t_1) * i) tmp = 0 if t_2 <= math.inf: tmp = t_2 * 2.0 else: tmp = -2.0 * (c * (t_1 * i)) return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(a + Float64(b * c)) t_2 = Float64(Float64(Float64(z * t) + Float64(x * y)) - Float64(Float64(c * t_1) * i)) tmp = 0.0 if (t_2 <= Inf) tmp = Float64(t_2 * 2.0); else tmp = Float64(-2.0 * Float64(c * Float64(t_1 * i))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = a + (b * c); t_2 = ((z * t) + (x * y)) - ((c * t_1) * i); tmp = 0.0; if (t_2 <= Inf) tmp = t_2 * 2.0; else tmp = -2.0 * (c * (t_1 * i)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(z * t), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision] - N[(N[(c * t$95$1), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, Infinity], N[(t$95$2 * 2.0), $MachinePrecision], N[(-2.0 * N[(c * N[(t$95$1 * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a + b \cdot c\\
t_2 := \left(z \cdot t + x \cdot y\right) - \left(c \cdot t_1\right) \cdot i\\
\mathbf{if}\;t_2 \leq \infty:\\
\;\;\;\;t_2 \cdot 2\\
\mathbf{else}:\\
\;\;\;\;-2 \cdot \left(c \cdot \left(t_1 \cdot 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.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 62.8%
Taylor expanded in i around 0 62.8%
Final simplification94.6%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ a (* b c))) (t_2 (+ (* z t) (* x y))))
(if (<= (- t_2 (* (* c t_1) i)) 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 = (z * t) + (x * y);
double tmp;
if ((t_2 - ((c * t_1) * i)) <= ((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 = (z * t) + (x * y);
double tmp;
if ((t_2 - ((c * t_1) * i)) <= 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 = (z * t) + (x * y) tmp = 0 if (t_2 - ((c * t_1) * i)) <= 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(z * t) + Float64(x * y)) tmp = 0.0 if (Float64(t_2 - Float64(Float64(c * t_1) * i)) <= 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 = (z * t) + (x * y); tmp = 0.0; if ((t_2 - ((c * t_1) * i)) <= 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[(z * t), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(t$95$2 - N[(N[(c * t$95$1), $MachinePrecision] * i), $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 := z \cdot t + x \cdot y\\
\mathbf{if}\;t_2 - \left(c \cdot t_1\right) \cdot i \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.7%
associate-*l*97.8%
fma-def97.8%
Simplified97.8%
fma-def97.8%
+-commutative97.8%
Applied egg-rr97.8%
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 62.8%
Taylor expanded in i around 0 62.8%
Final simplification95.7%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* 2.0 (* z t)))
(t_2 (* 2.0 (* x y)))
(t_3 (* -2.0 (* c (* b (* c i))))))
(if (<= c -2.8e+100)
t_3
(if (<= c -6.6e+26)
t_1
(if (<= c -2.25e-94)
(* 2.0 (* i (* c (- a))))
(if (<= c 1.3e-285)
t_1
(if (<= c 7e-152)
t_2
(if (<= c 1.28e-76) t_1 (if (<= c 3.2e-14) t_2 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 * (z * t);
double t_2 = 2.0 * (x * y);
double t_3 = -2.0 * (c * (b * (c * i)));
double tmp;
if (c <= -2.8e+100) {
tmp = t_3;
} else if (c <= -6.6e+26) {
tmp = t_1;
} else if (c <= -2.25e-94) {
tmp = 2.0 * (i * (c * -a));
} else if (c <= 1.3e-285) {
tmp = t_1;
} else if (c <= 7e-152) {
tmp = t_2;
} else if (c <= 1.28e-76) {
tmp = t_1;
} else if (c <= 3.2e-14) {
tmp = t_2;
} 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 * (z * t)
t_2 = 2.0d0 * (x * y)
t_3 = (-2.0d0) * (c * (b * (c * i)))
if (c <= (-2.8d+100)) then
tmp = t_3
else if (c <= (-6.6d+26)) then
tmp = t_1
else if (c <= (-2.25d-94)) then
tmp = 2.0d0 * (i * (c * -a))
else if (c <= 1.3d-285) then
tmp = t_1
else if (c <= 7d-152) then
tmp = t_2
else if (c <= 1.28d-76) then
tmp = t_1
else if (c <= 3.2d-14) then
tmp = t_2
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 * (z * t);
double t_2 = 2.0 * (x * y);
double t_3 = -2.0 * (c * (b * (c * i)));
double tmp;
if (c <= -2.8e+100) {
tmp = t_3;
} else if (c <= -6.6e+26) {
tmp = t_1;
} else if (c <= -2.25e-94) {
tmp = 2.0 * (i * (c * -a));
} else if (c <= 1.3e-285) {
tmp = t_1;
} else if (c <= 7e-152) {
tmp = t_2;
} else if (c <= 1.28e-76) {
tmp = t_1;
} else if (c <= 3.2e-14) {
tmp = t_2;
} else {
tmp = t_3;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = 2.0 * (z * t) t_2 = 2.0 * (x * y) t_3 = -2.0 * (c * (b * (c * i))) tmp = 0 if c <= -2.8e+100: tmp = t_3 elif c <= -6.6e+26: tmp = t_1 elif c <= -2.25e-94: tmp = 2.0 * (i * (c * -a)) elif c <= 1.3e-285: tmp = t_1 elif c <= 7e-152: tmp = t_2 elif c <= 1.28e-76: tmp = t_1 elif c <= 3.2e-14: tmp = t_2 else: tmp = t_3 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(x * y)) t_3 = Float64(-2.0 * Float64(c * Float64(b * Float64(c * i)))) tmp = 0.0 if (c <= -2.8e+100) tmp = t_3; elseif (c <= -6.6e+26) tmp = t_1; elseif (c <= -2.25e-94) tmp = Float64(2.0 * Float64(i * Float64(c * Float64(-a)))); elseif (c <= 1.3e-285) tmp = t_1; elseif (c <= 7e-152) tmp = t_2; elseif (c <= 1.28e-76) tmp = t_1; elseif (c <= 3.2e-14) tmp = t_2; else tmp = t_3; 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 * (x * y); t_3 = -2.0 * (c * (b * (c * i))); tmp = 0.0; if (c <= -2.8e+100) tmp = t_3; elseif (c <= -6.6e+26) tmp = t_1; elseif (c <= -2.25e-94) tmp = 2.0 * (i * (c * -a)); elseif (c <= 1.3e-285) tmp = t_1; elseif (c <= 7e-152) tmp = t_2; elseif (c <= 1.28e-76) tmp = t_1; elseif (c <= 3.2e-14) tmp = t_2; 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[(z * t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(2.0 * N[(x * y), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(-2.0 * N[(c * N[(b * N[(c * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[c, -2.8e+100], t$95$3, If[LessEqual[c, -6.6e+26], t$95$1, If[LessEqual[c, -2.25e-94], N[(2.0 * N[(i * N[(c * (-a)), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[c, 1.3e-285], t$95$1, If[LessEqual[c, 7e-152], t$95$2, If[LessEqual[c, 1.28e-76], t$95$1, If[LessEqual[c, 3.2e-14], t$95$2, t$95$3]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := 2 \cdot \left(z \cdot t\right)\\
t_2 := 2 \cdot \left(x \cdot y\right)\\
t_3 := -2 \cdot \left(c \cdot \left(b \cdot \left(c \cdot i\right)\right)\right)\\
\mathbf{if}\;c \leq -2.8 \cdot 10^{+100}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;c \leq -6.6 \cdot 10^{+26}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;c \leq -2.25 \cdot 10^{-94}:\\
\;\;\;\;2 \cdot \left(i \cdot \left(c \cdot \left(-a\right)\right)\right)\\
\mathbf{elif}\;c \leq 1.3 \cdot 10^{-285}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;c \leq 7 \cdot 10^{-152}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;c \leq 1.28 \cdot 10^{-76}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;c \leq 3.2 \cdot 10^{-14}:\\
\;\;\;\;t_2\\
\mathbf{else}:\\
\;\;\;\;t_3\\
\end{array}
\end{array}
if c < -2.7999999999999998e100 or 3.2000000000000002e-14 < c Initial program 81.1%
Taylor expanded in b around inf 68.5%
mul-1-neg68.5%
*-commutative68.5%
distribute-rgt-neg-in68.5%
unpow268.5%
distribute-rgt-neg-in68.5%
Simplified68.5%
Taylor expanded in i around 0 68.5%
unpow268.5%
associate-*r*71.6%
Simplified71.6%
Taylor expanded in c around 0 68.5%
unpow268.5%
associate-*r*70.3%
associate-*r*69.6%
*-commutative69.6%
Simplified69.6%
if -2.7999999999999998e100 < c < -6.59999999999999987e26 or -2.2500000000000001e-94 < c < 1.3000000000000001e-285 or 7.0000000000000002e-152 < c < 1.28e-76Initial program 94.8%
Taylor expanded in z around inf 61.5%
if -6.59999999999999987e26 < c < -2.2500000000000001e-94Initial program 96.3%
Taylor expanded in a around inf 79.6%
Taylor expanded in z around 0 59.9%
associate-*r*62.8%
*-commutative62.8%
*-commutative62.8%
*-commutative62.8%
Simplified62.8%
Taylor expanded in y around 0 36.4%
mul-1-neg36.4%
associate-*r*39.3%
distribute-rgt-neg-in39.3%
*-commutative39.3%
associate-*r*39.4%
Simplified39.4%
if 1.3000000000000001e-285 < c < 7.0000000000000002e-152 or 1.28e-76 < c < 3.2000000000000002e-14Initial program 99.9%
Taylor expanded in x around inf 54.0%
Final simplification60.6%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* 2.0 (* z t)))
(t_2 (* 2.0 (* x y)))
(t_3 (* -2.0 (* b (* i (* c c))))))
(if (<= c -2.05e+62)
t_3
(if (<= c -6.6e+26)
t_1
(if (<= c -1.05e-90)
(* 2.0 (* i (* c (- a))))
(if (<= c 4.8e-285)
t_1
(if (<= c 1e-149)
t_2
(if (<= c 2.2e-76) t_1 (if (<= c 3.35e-15) t_2 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 * (z * t);
double t_2 = 2.0 * (x * y);
double t_3 = -2.0 * (b * (i * (c * c)));
double tmp;
if (c <= -2.05e+62) {
tmp = t_3;
} else if (c <= -6.6e+26) {
tmp = t_1;
} else if (c <= -1.05e-90) {
tmp = 2.0 * (i * (c * -a));
} else if (c <= 4.8e-285) {
tmp = t_1;
} else if (c <= 1e-149) {
tmp = t_2;
} else if (c <= 2.2e-76) {
tmp = t_1;
} else if (c <= 3.35e-15) {
tmp = t_2;
} 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 * (z * t)
t_2 = 2.0d0 * (x * y)
t_3 = (-2.0d0) * (b * (i * (c * c)))
if (c <= (-2.05d+62)) then
tmp = t_3
else if (c <= (-6.6d+26)) then
tmp = t_1
else if (c <= (-1.05d-90)) then
tmp = 2.0d0 * (i * (c * -a))
else if (c <= 4.8d-285) then
tmp = t_1
else if (c <= 1d-149) then
tmp = t_2
else if (c <= 2.2d-76) then
tmp = t_1
else if (c <= 3.35d-15) then
tmp = t_2
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 * (z * t);
double t_2 = 2.0 * (x * y);
double t_3 = -2.0 * (b * (i * (c * c)));
double tmp;
if (c <= -2.05e+62) {
tmp = t_3;
} else if (c <= -6.6e+26) {
tmp = t_1;
} else if (c <= -1.05e-90) {
tmp = 2.0 * (i * (c * -a));
} else if (c <= 4.8e-285) {
tmp = t_1;
} else if (c <= 1e-149) {
tmp = t_2;
} else if (c <= 2.2e-76) {
tmp = t_1;
} else if (c <= 3.35e-15) {
tmp = t_2;
} else {
tmp = t_3;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = 2.0 * (z * t) t_2 = 2.0 * (x * y) t_3 = -2.0 * (b * (i * (c * c))) tmp = 0 if c <= -2.05e+62: tmp = t_3 elif c <= -6.6e+26: tmp = t_1 elif c <= -1.05e-90: tmp = 2.0 * (i * (c * -a)) elif c <= 4.8e-285: tmp = t_1 elif c <= 1e-149: tmp = t_2 elif c <= 2.2e-76: tmp = t_1 elif c <= 3.35e-15: tmp = t_2 else: tmp = t_3 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(x * y)) t_3 = Float64(-2.0 * Float64(b * Float64(i * Float64(c * c)))) tmp = 0.0 if (c <= -2.05e+62) tmp = t_3; elseif (c <= -6.6e+26) tmp = t_1; elseif (c <= -1.05e-90) tmp = Float64(2.0 * Float64(i * Float64(c * Float64(-a)))); elseif (c <= 4.8e-285) tmp = t_1; elseif (c <= 1e-149) tmp = t_2; elseif (c <= 2.2e-76) tmp = t_1; elseif (c <= 3.35e-15) tmp = t_2; else tmp = t_3; 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 * (x * y); t_3 = -2.0 * (b * (i * (c * c))); tmp = 0.0; if (c <= -2.05e+62) tmp = t_3; elseif (c <= -6.6e+26) tmp = t_1; elseif (c <= -1.05e-90) tmp = 2.0 * (i * (c * -a)); elseif (c <= 4.8e-285) tmp = t_1; elseif (c <= 1e-149) tmp = t_2; elseif (c <= 2.2e-76) tmp = t_1; elseif (c <= 3.35e-15) tmp = t_2; 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[(z * t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(2.0 * N[(x * y), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(-2.0 * N[(b * N[(i * N[(c * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[c, -2.05e+62], t$95$3, If[LessEqual[c, -6.6e+26], t$95$1, If[LessEqual[c, -1.05e-90], N[(2.0 * N[(i * N[(c * (-a)), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[c, 4.8e-285], t$95$1, If[LessEqual[c, 1e-149], t$95$2, If[LessEqual[c, 2.2e-76], t$95$1, If[LessEqual[c, 3.35e-15], t$95$2, t$95$3]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := 2 \cdot \left(z \cdot t\right)\\
t_2 := 2 \cdot \left(x \cdot y\right)\\
t_3 := -2 \cdot \left(b \cdot \left(i \cdot \left(c \cdot c\right)\right)\right)\\
\mathbf{if}\;c \leq -2.05 \cdot 10^{+62}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;c \leq -6.6 \cdot 10^{+26}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;c \leq -1.05 \cdot 10^{-90}:\\
\;\;\;\;2 \cdot \left(i \cdot \left(c \cdot \left(-a\right)\right)\right)\\
\mathbf{elif}\;c \leq 4.8 \cdot 10^{-285}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;c \leq 10^{-149}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;c \leq 2.2 \cdot 10^{-76}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;c \leq 3.35 \cdot 10^{-15}:\\
\;\;\;\;t_2\\
\mathbf{else}:\\
\;\;\;\;t_3\\
\end{array}
\end{array}
if c < -2.04999999999999992e62 or 3.35e-15 < c Initial program 81.8%
Taylor expanded in b around inf 66.6%
mul-1-neg66.6%
*-commutative66.6%
distribute-rgt-neg-in66.6%
unpow266.6%
distribute-rgt-neg-in66.6%
Simplified66.6%
Taylor expanded in i around 0 66.6%
unpow266.6%
associate-*r*70.4%
Simplified70.4%
if -2.04999999999999992e62 < c < -6.59999999999999987e26 or -1.05e-90 < c < 4.8000000000000001e-285 or 9.99999999999999979e-150 < c < 2.19999999999999999e-76Initial program 95.5%
Taylor expanded in z around inf 63.5%
if -6.59999999999999987e26 < c < -1.05e-90Initial program 96.3%
Taylor expanded in a around inf 79.6%
Taylor expanded in z around 0 59.9%
associate-*r*62.8%
*-commutative62.8%
*-commutative62.8%
*-commutative62.8%
Simplified62.8%
Taylor expanded in y around 0 36.4%
mul-1-neg36.4%
associate-*r*39.3%
distribute-rgt-neg-in39.3%
*-commutative39.3%
associate-*r*39.4%
Simplified39.4%
if 4.8000000000000001e-285 < c < 9.99999999999999979e-150 or 2.19999999999999999e-76 < c < 3.35e-15Initial program 99.9%
Taylor expanded in x around inf 54.0%
Final simplification61.8%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ (* z t) (* x y))))
(if (<= a -7.8e+70)
(* 2.0 (- t_1 (* i (* a c))))
(if (<= a 520000.0)
(* 2.0 (- t_1 (* c (* c (* b i)))))
(* 2.0 (- t_1 (* a (* c i))))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = (z * t) + (x * y);
double tmp;
if (a <= -7.8e+70) {
tmp = 2.0 * (t_1 - (i * (a * c)));
} else if (a <= 520000.0) {
tmp = 2.0 * (t_1 - (c * (c * (b * i))));
} else {
tmp = 2.0 * (t_1 - (a * (c * i)));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: t_1
real(8) :: tmp
t_1 = (z * t) + (x * y)
if (a <= (-7.8d+70)) then
tmp = 2.0d0 * (t_1 - (i * (a * c)))
else if (a <= 520000.0d0) then
tmp = 2.0d0 * (t_1 - (c * (c * (b * i))))
else
tmp = 2.0d0 * (t_1 - (a * (c * i)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = (z * t) + (x * y);
double tmp;
if (a <= -7.8e+70) {
tmp = 2.0 * (t_1 - (i * (a * c)));
} else if (a <= 520000.0) {
tmp = 2.0 * (t_1 - (c * (c * (b * i))));
} else {
tmp = 2.0 * (t_1 - (a * (c * i)));
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = (z * t) + (x * y) tmp = 0 if a <= -7.8e+70: tmp = 2.0 * (t_1 - (i * (a * c))) elif a <= 520000.0: tmp = 2.0 * (t_1 - (c * (c * (b * i)))) else: tmp = 2.0 * (t_1 - (a * (c * i))) return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(Float64(z * t) + Float64(x * y)) tmp = 0.0 if (a <= -7.8e+70) tmp = Float64(2.0 * Float64(t_1 - Float64(i * Float64(a * c)))); elseif (a <= 520000.0) tmp = Float64(2.0 * Float64(t_1 - Float64(c * Float64(c * Float64(b * i))))); else tmp = Float64(2.0 * Float64(t_1 - Float64(a * Float64(c * i)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = (z * t) + (x * y); tmp = 0.0; if (a <= -7.8e+70) tmp = 2.0 * (t_1 - (i * (a * c))); elseif (a <= 520000.0) tmp = 2.0 * (t_1 - (c * (c * (b * i)))); else tmp = 2.0 * (t_1 - (a * (c * i))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(z * t), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -7.8e+70], N[(2.0 * N[(t$95$1 - N[(i * N[(a * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 520000.0], N[(2.0 * N[(t$95$1 - N[(c * N[(c * N[(b * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(t$95$1 - N[(a * N[(c * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := z \cdot t + x \cdot y\\
\mathbf{if}\;a \leq -7.8 \cdot 10^{+70}:\\
\;\;\;\;2 \cdot \left(t_1 - i \cdot \left(a \cdot c\right)\right)\\
\mathbf{elif}\;a \leq 520000:\\
\;\;\;\;2 \cdot \left(t_1 - c \cdot \left(c \cdot \left(b \cdot i\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(t_1 - a \cdot \left(c \cdot i\right)\right)\\
\end{array}
\end{array}
if a < -7.79999999999999949e70Initial program 97.9%
Taylor expanded in a around inf 86.5%
if -7.79999999999999949e70 < a < 5.2e5Initial program 90.5%
Taylor expanded in a around 0 85.2%
unpow285.2%
associate-*r*91.1%
Simplified91.1%
if 5.2e5 < a Initial program 85.0%
associate-*l*92.3%
fma-def95.6%
Simplified95.6%
fma-def92.3%
+-commutative92.3%
Applied egg-rr92.3%
Taylor expanded in a around inf 84.8%
Final simplification88.7%
(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 (<= t -2.05e-82)
t_2
(if (<= t -9.5e-205)
t_1
(if (<= t 7e-295)
(* 2.0 (* i (* c (- a))))
(if (<= t 8.5e+50)
t_1
(if (or (<= t 4.2e+130) (not (<= t 1.95e+148)))
t_2
(* -2.0 (* c (* a i))))))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = 2.0 * (x * y);
double t_2 = 2.0 * (z * t);
double tmp;
if (t <= -2.05e-82) {
tmp = t_2;
} else if (t <= -9.5e-205) {
tmp = t_1;
} else if (t <= 7e-295) {
tmp = 2.0 * (i * (c * -a));
} else if (t <= 8.5e+50) {
tmp = t_1;
} else if ((t <= 4.2e+130) || !(t <= 1.95e+148)) {
tmp = t_2;
} else {
tmp = -2.0 * (c * (a * i));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = 2.0d0 * (x * y)
t_2 = 2.0d0 * (z * t)
if (t <= (-2.05d-82)) then
tmp = t_2
else if (t <= (-9.5d-205)) then
tmp = t_1
else if (t <= 7d-295) then
tmp = 2.0d0 * (i * (c * -a))
else if (t <= 8.5d+50) then
tmp = t_1
else if ((t <= 4.2d+130) .or. (.not. (t <= 1.95d+148))) then
tmp = t_2
else
tmp = (-2.0d0) * (c * (a * i))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = 2.0 * (x * y);
double t_2 = 2.0 * (z * t);
double tmp;
if (t <= -2.05e-82) {
tmp = t_2;
} else if (t <= -9.5e-205) {
tmp = t_1;
} else if (t <= 7e-295) {
tmp = 2.0 * (i * (c * -a));
} else if (t <= 8.5e+50) {
tmp = t_1;
} else if ((t <= 4.2e+130) || !(t <= 1.95e+148)) {
tmp = t_2;
} else {
tmp = -2.0 * (c * (a * i));
}
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 t <= -2.05e-82: tmp = t_2 elif t <= -9.5e-205: tmp = t_1 elif t <= 7e-295: tmp = 2.0 * (i * (c * -a)) elif t <= 8.5e+50: tmp = t_1 elif (t <= 4.2e+130) or not (t <= 1.95e+148): tmp = t_2 else: tmp = -2.0 * (c * (a * i)) 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 (t <= -2.05e-82) tmp = t_2; elseif (t <= -9.5e-205) tmp = t_1; elseif (t <= 7e-295) tmp = Float64(2.0 * Float64(i * Float64(c * Float64(-a)))); elseif (t <= 8.5e+50) tmp = t_1; elseif ((t <= 4.2e+130) || !(t <= 1.95e+148)) tmp = t_2; else tmp = Float64(-2.0 * Float64(c * Float64(a * i))); 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 (t <= -2.05e-82) tmp = t_2; elseif (t <= -9.5e-205) tmp = t_1; elseif (t <= 7e-295) tmp = 2.0 * (i * (c * -a)); elseif (t <= 8.5e+50) tmp = t_1; elseif ((t <= 4.2e+130) || ~((t <= 1.95e+148))) tmp = t_2; else tmp = -2.0 * (c * (a * i)); 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[t, -2.05e-82], t$95$2, If[LessEqual[t, -9.5e-205], t$95$1, If[LessEqual[t, 7e-295], N[(2.0 * N[(i * N[(c * (-a)), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 8.5e+50], t$95$1, If[Or[LessEqual[t, 4.2e+130], N[Not[LessEqual[t, 1.95e+148]], $MachinePrecision]], t$95$2, N[(-2.0 * N[(c * N[(a * i), $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}\;t \leq -2.05 \cdot 10^{-82}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;t \leq -9.5 \cdot 10^{-205}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t \leq 7 \cdot 10^{-295}:\\
\;\;\;\;2 \cdot \left(i \cdot \left(c \cdot \left(-a\right)\right)\right)\\
\mathbf{elif}\;t \leq 8.5 \cdot 10^{+50}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t \leq 4.2 \cdot 10^{+130} \lor \neg \left(t \leq 1.95 \cdot 10^{+148}\right):\\
\;\;\;\;t_2\\
\mathbf{else}:\\
\;\;\;\;-2 \cdot \left(c \cdot \left(a \cdot i\right)\right)\\
\end{array}
\end{array}
if t < -2.04999999999999998e-82 or 8.49999999999999961e50 < t < 4.19999999999999981e130 or 1.95000000000000001e148 < t Initial program 87.4%
Taylor expanded in z around inf 53.0%
if -2.04999999999999998e-82 < t < -9.49999999999999957e-205 or 6.99999999999999977e-295 < t < 8.49999999999999961e50Initial program 93.8%
Taylor expanded in x around inf 39.3%
if -9.49999999999999957e-205 < t < 6.99999999999999977e-295Initial program 95.0%
Taylor expanded in a around inf 57.9%
Taylor expanded in z around 0 39.5%
associate-*r*53.1%
*-commutative53.1%
*-commutative53.1%
*-commutative53.1%
Simplified53.1%
Taylor expanded in y around 0 26.0%
mul-1-neg26.0%
associate-*r*30.3%
distribute-rgt-neg-in30.3%
*-commutative30.3%
associate-*r*39.6%
Simplified39.6%
if 4.19999999999999981e130 < t < 1.95000000000000001e148Initial program 99.7%
Taylor expanded in a around inf 79.7%
Taylor expanded in z around 0 60.5%
associate-*r*60.1%
*-commutative60.1%
*-commutative60.1%
*-commutative60.1%
Simplified60.1%
Taylor expanded in y around 0 60.5%
mul-1-neg60.5%
associate-*r*60.2%
distribute-rgt-neg-in60.2%
*-commutative60.2%
associate-*r*60.1%
Simplified60.1%
Taylor expanded in i around 0 60.5%
*-commutative60.5%
Simplified60.5%
Final simplification46.9%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* 2.0 (* z t))) (t_2 (* 2.0 (* x y))))
(if (<= c -2.25e+100)
(* -2.0 (* c (* c (* b i))))
(if (<= c 1.1e-285)
t_1
(if (<= c 2e-149)
t_2
(if (<= c 6.5e-76)
t_1
(if (<= c 1.02e-14) t_2 (* -2.0 (* c (* b (* c i)))))))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = 2.0 * (z * t);
double t_2 = 2.0 * (x * y);
double tmp;
if (c <= -2.25e+100) {
tmp = -2.0 * (c * (c * (b * i)));
} else if (c <= 1.1e-285) {
tmp = t_1;
} else if (c <= 2e-149) {
tmp = t_2;
} else if (c <= 6.5e-76) {
tmp = t_1;
} else if (c <= 1.02e-14) {
tmp = t_2;
} else {
tmp = -2.0 * (c * (b * (c * i)));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = 2.0d0 * (z * t)
t_2 = 2.0d0 * (x * y)
if (c <= (-2.25d+100)) then
tmp = (-2.0d0) * (c * (c * (b * i)))
else if (c <= 1.1d-285) then
tmp = t_1
else if (c <= 2d-149) then
tmp = t_2
else if (c <= 6.5d-76) then
tmp = t_1
else if (c <= 1.02d-14) then
tmp = t_2
else
tmp = (-2.0d0) * (c * (b * (c * i)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = 2.0 * (z * t);
double t_2 = 2.0 * (x * y);
double tmp;
if (c <= -2.25e+100) {
tmp = -2.0 * (c * (c * (b * i)));
} else if (c <= 1.1e-285) {
tmp = t_1;
} else if (c <= 2e-149) {
tmp = t_2;
} else if (c <= 6.5e-76) {
tmp = t_1;
} else if (c <= 1.02e-14) {
tmp = t_2;
} else {
tmp = -2.0 * (c * (b * (c * i)));
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = 2.0 * (z * t) t_2 = 2.0 * (x * y) tmp = 0 if c <= -2.25e+100: tmp = -2.0 * (c * (c * (b * i))) elif c <= 1.1e-285: tmp = t_1 elif c <= 2e-149: tmp = t_2 elif c <= 6.5e-76: tmp = t_1 elif c <= 1.02e-14: tmp = t_2 else: tmp = -2.0 * (c * (b * (c * i))) return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(2.0 * Float64(z * t)) t_2 = Float64(2.0 * Float64(x * y)) tmp = 0.0 if (c <= -2.25e+100) tmp = Float64(-2.0 * Float64(c * Float64(c * Float64(b * i)))); elseif (c <= 1.1e-285) tmp = t_1; elseif (c <= 2e-149) tmp = t_2; elseif (c <= 6.5e-76) tmp = t_1; elseif (c <= 1.02e-14) tmp = t_2; else tmp = Float64(-2.0 * Float64(c * Float64(b * Float64(c * i)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = 2.0 * (z * t); t_2 = 2.0 * (x * y); tmp = 0.0; if (c <= -2.25e+100) tmp = -2.0 * (c * (c * (b * i))); elseif (c <= 1.1e-285) tmp = t_1; elseif (c <= 2e-149) tmp = t_2; elseif (c <= 6.5e-76) tmp = t_1; elseif (c <= 1.02e-14) tmp = t_2; else tmp = -2.0 * (c * (b * (c * i))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(2.0 * N[(z * t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(2.0 * N[(x * y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[c, -2.25e+100], N[(-2.0 * N[(c * N[(c * N[(b * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[c, 1.1e-285], t$95$1, If[LessEqual[c, 2e-149], t$95$2, If[LessEqual[c, 6.5e-76], t$95$1, If[LessEqual[c, 1.02e-14], t$95$2, N[(-2.0 * N[(c * N[(b * N[(c * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := 2 \cdot \left(z \cdot t\right)\\
t_2 := 2 \cdot \left(x \cdot y\right)\\
\mathbf{if}\;c \leq -2.25 \cdot 10^{+100}:\\
\;\;\;\;-2 \cdot \left(c \cdot \left(c \cdot \left(b \cdot i\right)\right)\right)\\
\mathbf{elif}\;c \leq 1.1 \cdot 10^{-285}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;c \leq 2 \cdot 10^{-149}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;c \leq 6.5 \cdot 10^{-76}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;c \leq 1.02 \cdot 10^{-14}:\\
\;\;\;\;t_2\\
\mathbf{else}:\\
\;\;\;\;-2 \cdot \left(c \cdot \left(b \cdot \left(c \cdot i\right)\right)\right)\\
\end{array}
\end{array}
if c < -2.25000000000000018e100Initial program 78.0%
Taylor expanded in b around inf 76.0%
mul-1-neg76.0%
*-commutative76.0%
distribute-rgt-neg-in76.0%
unpow276.0%
distribute-rgt-neg-in76.0%
Simplified76.0%
Taylor expanded in i around 0 76.0%
unpow276.0%
associate-*r*78.9%
Simplified78.9%
Taylor expanded in c around 0 76.0%
unpow276.0%
associate-*r*78.3%
Simplified78.3%
if -2.25000000000000018e100 < c < 1.1e-285 or 1.99999999999999996e-149 < c < 6.5e-76Initial program 95.2%
Taylor expanded in z around inf 50.0%
if 1.1e-285 < c < 1.99999999999999996e-149 or 6.5e-76 < c < 1.02e-14Initial program 99.9%
Taylor expanded in x around inf 54.0%
if 1.02e-14 < c Initial program 82.9%
Taylor expanded in b around inf 64.2%
mul-1-neg64.2%
*-commutative64.2%
distribute-rgt-neg-in64.2%
unpow264.2%
distribute-rgt-neg-in64.2%
Simplified64.2%
Taylor expanded in i around 0 64.2%
unpow264.2%
associate-*r*67.5%
Simplified67.5%
Taylor expanded in c around 0 64.2%
unpow264.2%
associate-*r*65.7%
associate-*r*65.9%
*-commutative65.9%
Simplified65.9%
Final simplification58.7%
(FPCore (x y z t a b c i)
:precision binary64
(if (or (<= c -8e+52)
(and (not (<= c -6.6e+26))
(or (<= c -1.14e-85) (not (<= c 1.12e-13)))))
(* -2.0 (* c (* (+ a (* b c)) i)))
(* (+ (* z t) (* x y)) 2.0)))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((c <= -8e+52) || (!(c <= -6.6e+26) && ((c <= -1.14e-85) || !(c <= 1.12e-13)))) {
tmp = -2.0 * (c * ((a + (b * c)) * i));
} else {
tmp = ((z * t) + (x * y)) * 2.0;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: tmp
if ((c <= (-8d+52)) .or. (.not. (c <= (-6.6d+26))) .and. (c <= (-1.14d-85)) .or. (.not. (c <= 1.12d-13))) then
tmp = (-2.0d0) * (c * ((a + (b * c)) * i))
else
tmp = ((z * t) + (x * y)) * 2.0d0
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((c <= -8e+52) || (!(c <= -6.6e+26) && ((c <= -1.14e-85) || !(c <= 1.12e-13)))) {
tmp = -2.0 * (c * ((a + (b * c)) * i));
} else {
tmp = ((z * t) + (x * y)) * 2.0;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if (c <= -8e+52) or (not (c <= -6.6e+26) and ((c <= -1.14e-85) or not (c <= 1.12e-13))): tmp = -2.0 * (c * ((a + (b * c)) * i)) else: tmp = ((z * t) + (x * y)) * 2.0 return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if ((c <= -8e+52) || (!(c <= -6.6e+26) && ((c <= -1.14e-85) || !(c <= 1.12e-13)))) tmp = Float64(-2.0 * Float64(c * Float64(Float64(a + Float64(b * c)) * i))); else tmp = Float64(Float64(Float64(z * t) + Float64(x * y)) * 2.0); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if ((c <= -8e+52) || (~((c <= -6.6e+26)) && ((c <= -1.14e-85) || ~((c <= 1.12e-13))))) tmp = -2.0 * (c * ((a + (b * c)) * i)); else tmp = ((z * t) + (x * y)) * 2.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[c, -8e+52], And[N[Not[LessEqual[c, -6.6e+26]], $MachinePrecision], Or[LessEqual[c, -1.14e-85], N[Not[LessEqual[c, 1.12e-13]], $MachinePrecision]]]], N[(-2.0 * N[(c * N[(N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(z * t), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;c \leq -8 \cdot 10^{+52} \lor \neg \left(c \leq -6.6 \cdot 10^{+26}\right) \land \left(c \leq -1.14 \cdot 10^{-85} \lor \neg \left(c \leq 1.12 \cdot 10^{-13}\right)\right):\\
\;\;\;\;-2 \cdot \left(c \cdot \left(\left(a + b \cdot c\right) \cdot i\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(z \cdot t + x \cdot y\right) \cdot 2\\
\end{array}
\end{array}
if c < -7.9999999999999999e52 or -6.59999999999999987e26 < c < -1.1400000000000001e-85 or 1.12e-13 < c Initial program 84.7%
Taylor expanded in i around inf 75.7%
Taylor expanded in i around 0 75.7%
if -7.9999999999999999e52 < c < -6.59999999999999987e26 or -1.1400000000000001e-85 < c < 1.12e-13Initial program 97.4%
Taylor expanded in c around 0 85.3%
Final simplification80.2%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* -2.0 (* c (* (+ a (* b c)) i)))))
(if (<= c -2.4e+62)
t_1
(if (<= c -6.6e+26)
(* 2.0 (- (* z t) (* c (* a i))))
(if (or (<= c -1.14e-85) (not (<= c 1.15e-13)))
t_1
(* (+ (* z t) (* x y)) 2.0))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = -2.0 * (c * ((a + (b * c)) * i));
double tmp;
if (c <= -2.4e+62) {
tmp = t_1;
} else if (c <= -6.6e+26) {
tmp = 2.0 * ((z * t) - (c * (a * i)));
} else if ((c <= -1.14e-85) || !(c <= 1.15e-13)) {
tmp = t_1;
} else {
tmp = ((z * t) + (x * y)) * 2.0;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: t_1
real(8) :: tmp
t_1 = (-2.0d0) * (c * ((a + (b * c)) * i))
if (c <= (-2.4d+62)) then
tmp = t_1
else if (c <= (-6.6d+26)) then
tmp = 2.0d0 * ((z * t) - (c * (a * i)))
else if ((c <= (-1.14d-85)) .or. (.not. (c <= 1.15d-13))) then
tmp = t_1
else
tmp = ((z * t) + (x * y)) * 2.0d0
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = -2.0 * (c * ((a + (b * c)) * i));
double tmp;
if (c <= -2.4e+62) {
tmp = t_1;
} else if (c <= -6.6e+26) {
tmp = 2.0 * ((z * t) - (c * (a * i)));
} else if ((c <= -1.14e-85) || !(c <= 1.15e-13)) {
tmp = t_1;
} else {
tmp = ((z * t) + (x * y)) * 2.0;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = -2.0 * (c * ((a + (b * c)) * i)) tmp = 0 if c <= -2.4e+62: tmp = t_1 elif c <= -6.6e+26: tmp = 2.0 * ((z * t) - (c * (a * i))) elif (c <= -1.14e-85) or not (c <= 1.15e-13): tmp = t_1 else: tmp = ((z * t) + (x * y)) * 2.0 return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(-2.0 * Float64(c * Float64(Float64(a + Float64(b * c)) * i))) tmp = 0.0 if (c <= -2.4e+62) tmp = t_1; elseif (c <= -6.6e+26) tmp = Float64(2.0 * Float64(Float64(z * t) - Float64(c * Float64(a * i)))); elseif ((c <= -1.14e-85) || !(c <= 1.15e-13)) tmp = t_1; else tmp = Float64(Float64(Float64(z * t) + Float64(x * y)) * 2.0); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = -2.0 * (c * ((a + (b * c)) * i)); tmp = 0.0; if (c <= -2.4e+62) tmp = t_1; elseif (c <= -6.6e+26) tmp = 2.0 * ((z * t) - (c * (a * i))); elseif ((c <= -1.14e-85) || ~((c <= 1.15e-13))) tmp = t_1; else tmp = ((z * t) + (x * y)) * 2.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(-2.0 * N[(c * N[(N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[c, -2.4e+62], t$95$1, If[LessEqual[c, -6.6e+26], N[(2.0 * N[(N[(z * t), $MachinePrecision] - N[(c * N[(a * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[c, -1.14e-85], N[Not[LessEqual[c, 1.15e-13]], $MachinePrecision]], t$95$1, N[(N[(N[(z * t), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := -2 \cdot \left(c \cdot \left(\left(a + b \cdot c\right) \cdot i\right)\right)\\
\mathbf{if}\;c \leq -2.4 \cdot 10^{+62}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;c \leq -6.6 \cdot 10^{+26}:\\
\;\;\;\;2 \cdot \left(z \cdot t - c \cdot \left(a \cdot i\right)\right)\\
\mathbf{elif}\;c \leq -1.14 \cdot 10^{-85} \lor \neg \left(c \leq 1.15 \cdot 10^{-13}\right):\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;\left(z \cdot t + x \cdot y\right) \cdot 2\\
\end{array}
\end{array}
if c < -2.4e62 or -6.59999999999999987e26 < c < -1.1400000000000001e-85 or 1.1499999999999999e-13 < c Initial program 84.6%
Taylor expanded in i around inf 75.5%
Taylor expanded in i around 0 75.5%
if -2.4e62 < c < -6.59999999999999987e26Initial program 90.8%
Taylor expanded in a around inf 73.7%
Taylor expanded in x around 0 74.3%
*-commutative74.3%
Simplified74.3%
if -1.1400000000000001e-85 < c < 1.1499999999999999e-13Initial program 98.1%
Taylor expanded in c around 0 86.6%
Final simplification80.2%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= c -3.5e+139) (not (<= c 1.12e+32))) (* -2.0 (* c (* (+ a (* b c)) i))) (* 2.0 (- (+ (* z t) (* x y)) (* i (* a c))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((c <= -3.5e+139) || !(c <= 1.12e+32)) {
tmp = -2.0 * (c * ((a + (b * c)) * i));
} else {
tmp = 2.0 * (((z * t) + (x * y)) - (i * (a * c)));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: tmp
if ((c <= (-3.5d+139)) .or. (.not. (c <= 1.12d+32))) then
tmp = (-2.0d0) * (c * ((a + (b * c)) * i))
else
tmp = 2.0d0 * (((z * t) + (x * y)) - (i * (a * c)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((c <= -3.5e+139) || !(c <= 1.12e+32)) {
tmp = -2.0 * (c * ((a + (b * c)) * i));
} else {
tmp = 2.0 * (((z * t) + (x * y)) - (i * (a * c)));
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if (c <= -3.5e+139) or not (c <= 1.12e+32): tmp = -2.0 * (c * ((a + (b * c)) * i)) else: tmp = 2.0 * (((z * t) + (x * y)) - (i * (a * c))) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if ((c <= -3.5e+139) || !(c <= 1.12e+32)) tmp = Float64(-2.0 * Float64(c * Float64(Float64(a + Float64(b * c)) * i))); else tmp = Float64(2.0 * Float64(Float64(Float64(z * t) + Float64(x * y)) - Float64(i * Float64(a * c)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if ((c <= -3.5e+139) || ~((c <= 1.12e+32))) tmp = -2.0 * (c * ((a + (b * c)) * i)); else tmp = 2.0 * (((z * t) + (x * y)) - (i * (a * c))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[c, -3.5e+139], N[Not[LessEqual[c, 1.12e+32]], $MachinePrecision]], N[(-2.0 * N[(c * N[(N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[(N[(z * t), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision] - N[(i * N[(a * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;c \leq -3.5 \cdot 10^{+139} \lor \neg \left(c \leq 1.12 \cdot 10^{+32}\right):\\
\;\;\;\;-2 \cdot \left(c \cdot \left(\left(a + b \cdot c\right) \cdot i\right)\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(\left(z \cdot t + x \cdot y\right) - i \cdot \left(a \cdot c\right)\right)\\
\end{array}
\end{array}
if c < -3.49999999999999978e139 or 1.12000000000000007e32 < c Initial program 80.3%
Taylor expanded in i around inf 83.9%
Taylor expanded in i around 0 83.9%
if -3.49999999999999978e139 < c < 1.12000000000000007e32Initial program 95.8%
Taylor expanded in a around inf 87.4%
Final simplification86.2%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= c -1.5e+137) (not (<= c 1.25e+39))) (* -2.0 (* c (* (+ a (* b c)) i))) (* 2.0 (- (+ (* z t) (* x y)) (* a (* c i))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((c <= -1.5e+137) || !(c <= 1.25e+39)) {
tmp = -2.0 * (c * ((a + (b * c)) * i));
} else {
tmp = 2.0 * (((z * t) + (x * y)) - (a * (c * i)));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: tmp
if ((c <= (-1.5d+137)) .or. (.not. (c <= 1.25d+39))) then
tmp = (-2.0d0) * (c * ((a + (b * c)) * i))
else
tmp = 2.0d0 * (((z * t) + (x * y)) - (a * (c * i)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((c <= -1.5e+137) || !(c <= 1.25e+39)) {
tmp = -2.0 * (c * ((a + (b * c)) * i));
} else {
tmp = 2.0 * (((z * t) + (x * y)) - (a * (c * i)));
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if (c <= -1.5e+137) or not (c <= 1.25e+39): tmp = -2.0 * (c * ((a + (b * c)) * i)) else: tmp = 2.0 * (((z * t) + (x * y)) - (a * (c * i))) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if ((c <= -1.5e+137) || !(c <= 1.25e+39)) tmp = Float64(-2.0 * Float64(c * Float64(Float64(a + Float64(b * c)) * i))); else tmp = Float64(2.0 * Float64(Float64(Float64(z * t) + Float64(x * y)) - Float64(a * Float64(c * i)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if ((c <= -1.5e+137) || ~((c <= 1.25e+39))) tmp = -2.0 * (c * ((a + (b * c)) * i)); else tmp = 2.0 * (((z * t) + (x * y)) - (a * (c * i))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[c, -1.5e+137], N[Not[LessEqual[c, 1.25e+39]], $MachinePrecision]], N[(-2.0 * N[(c * N[(N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[(N[(z * t), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision] - N[(a * N[(c * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;c \leq -1.5 \cdot 10^{+137} \lor \neg \left(c \leq 1.25 \cdot 10^{+39}\right):\\
\;\;\;\;-2 \cdot \left(c \cdot \left(\left(a + b \cdot c\right) \cdot i\right)\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(\left(z \cdot t + x \cdot y\right) - a \cdot \left(c \cdot i\right)\right)\\
\end{array}
\end{array}
if c < -1.5e137 or 1.25000000000000004e39 < c Initial program 80.3%
Taylor expanded in i around inf 83.9%
Taylor expanded in i around 0 83.9%
if -1.5e137 < c < 1.25000000000000004e39Initial program 95.8%
associate-*l*96.2%
fma-def96.8%
Simplified96.8%
fma-def96.2%
+-commutative96.2%
Applied egg-rr96.2%
Taylor expanded in a around inf 87.7%
Final simplification86.4%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* 2.0 (* z t))))
(if (<= t -3.6e-71)
t_1
(if (<= t 5.7e+47)
(* 2.0 (* x y))
(if (or (<= t 5e+130) (not (<= t 1.95e+148)))
t_1
(* -2.0 (* c (* a i))))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = 2.0 * (z * t);
double tmp;
if (t <= -3.6e-71) {
tmp = t_1;
} else if (t <= 5.7e+47) {
tmp = 2.0 * (x * y);
} else if ((t <= 5e+130) || !(t <= 1.95e+148)) {
tmp = t_1;
} else {
tmp = -2.0 * (c * (a * i));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: t_1
real(8) :: tmp
t_1 = 2.0d0 * (z * t)
if (t <= (-3.6d-71)) then
tmp = t_1
else if (t <= 5.7d+47) then
tmp = 2.0d0 * (x * y)
else if ((t <= 5d+130) .or. (.not. (t <= 1.95d+148))) then
tmp = t_1
else
tmp = (-2.0d0) * (c * (a * i))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = 2.0 * (z * t);
double tmp;
if (t <= -3.6e-71) {
tmp = t_1;
} else if (t <= 5.7e+47) {
tmp = 2.0 * (x * y);
} else if ((t <= 5e+130) || !(t <= 1.95e+148)) {
tmp = t_1;
} else {
tmp = -2.0 * (c * (a * i));
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = 2.0 * (z * t) tmp = 0 if t <= -3.6e-71: tmp = t_1 elif t <= 5.7e+47: tmp = 2.0 * (x * y) elif (t <= 5e+130) or not (t <= 1.95e+148): tmp = t_1 else: tmp = -2.0 * (c * (a * i)) return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(2.0 * Float64(z * t)) tmp = 0.0 if (t <= -3.6e-71) tmp = t_1; elseif (t <= 5.7e+47) tmp = Float64(2.0 * Float64(x * y)); elseif ((t <= 5e+130) || !(t <= 1.95e+148)) tmp = t_1; else tmp = Float64(-2.0 * Float64(c * Float64(a * i))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = 2.0 * (z * t); tmp = 0.0; if (t <= -3.6e-71) tmp = t_1; elseif (t <= 5.7e+47) tmp = 2.0 * (x * y); elseif ((t <= 5e+130) || ~((t <= 1.95e+148))) tmp = t_1; else tmp = -2.0 * (c * (a * i)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(2.0 * N[(z * t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -3.6e-71], t$95$1, If[LessEqual[t, 5.7e+47], N[(2.0 * N[(x * y), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[t, 5e+130], N[Not[LessEqual[t, 1.95e+148]], $MachinePrecision]], t$95$1, N[(-2.0 * N[(c * N[(a * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := 2 \cdot \left(z \cdot t\right)\\
\mathbf{if}\;t \leq -3.6 \cdot 10^{-71}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t \leq 5.7 \cdot 10^{+47}:\\
\;\;\;\;2 \cdot \left(x \cdot y\right)\\
\mathbf{elif}\;t \leq 5 \cdot 10^{+130} \lor \neg \left(t \leq 1.95 \cdot 10^{+148}\right):\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;-2 \cdot \left(c \cdot \left(a \cdot i\right)\right)\\
\end{array}
\end{array}
if t < -3.6e-71 or 5.6999999999999997e47 < t < 4.9999999999999996e130 or 1.95000000000000001e148 < t Initial program 87.4%
Taylor expanded in z around inf 53.0%
if -3.6e-71 < t < 5.6999999999999997e47Initial program 94.0%
Taylor expanded in x around inf 36.8%
if 4.9999999999999996e130 < t < 1.95000000000000001e148Initial program 99.7%
Taylor expanded in a around inf 79.7%
Taylor expanded in z around 0 60.5%
associate-*r*60.1%
*-commutative60.1%
*-commutative60.1%
*-commutative60.1%
Simplified60.1%
Taylor expanded in y around 0 60.5%
mul-1-neg60.5%
associate-*r*60.2%
distribute-rgt-neg-in60.2%
*-commutative60.2%
associate-*r*60.1%
Simplified60.1%
Taylor expanded in i around 0 60.5%
*-commutative60.5%
Simplified60.5%
Final simplification45.7%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= c -6.2e+77) (not (<= c 2.25e+38))) (* -2.0 (* b (* i (* c c)))) (* (+ (* z t) (* x y)) 2.0)))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((c <= -6.2e+77) || !(c <= 2.25e+38)) {
tmp = -2.0 * (b * (i * (c * c)));
} else {
tmp = ((z * t) + (x * y)) * 2.0;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: tmp
if ((c <= (-6.2d+77)) .or. (.not. (c <= 2.25d+38))) then
tmp = (-2.0d0) * (b * (i * (c * c)))
else
tmp = ((z * t) + (x * y)) * 2.0d0
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((c <= -6.2e+77) || !(c <= 2.25e+38)) {
tmp = -2.0 * (b * (i * (c * c)));
} else {
tmp = ((z * t) + (x * y)) * 2.0;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if (c <= -6.2e+77) or not (c <= 2.25e+38): tmp = -2.0 * (b * (i * (c * c))) else: tmp = ((z * t) + (x * y)) * 2.0 return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if ((c <= -6.2e+77) || !(c <= 2.25e+38)) tmp = Float64(-2.0 * Float64(b * Float64(i * Float64(c * c)))); else tmp = Float64(Float64(Float64(z * t) + Float64(x * y)) * 2.0); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if ((c <= -6.2e+77) || ~((c <= 2.25e+38))) tmp = -2.0 * (b * (i * (c * c))); else tmp = ((z * t) + (x * y)) * 2.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[c, -6.2e+77], N[Not[LessEqual[c, 2.25e+38]], $MachinePrecision]], N[(-2.0 * N[(b * N[(i * N[(c * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(z * t), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;c \leq -6.2 \cdot 10^{+77} \lor \neg \left(c \leq 2.25 \cdot 10^{+38}\right):\\
\;\;\;\;-2 \cdot \left(b \cdot \left(i \cdot \left(c \cdot c\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(z \cdot t + x \cdot y\right) \cdot 2\\
\end{array}
\end{array}
if c < -6.19999999999999997e77 or 2.2499999999999999e38 < c Initial program 79.3%
Taylor expanded in b around inf 69.3%
mul-1-neg69.3%
*-commutative69.3%
distribute-rgt-neg-in69.3%
unpow269.3%
distribute-rgt-neg-in69.3%
Simplified69.3%
Taylor expanded in i around 0 69.3%
unpow269.3%
associate-*r*73.6%
Simplified73.6%
if -6.19999999999999997e77 < c < 2.2499999999999999e38Initial program 97.4%
Taylor expanded in c around 0 74.0%
Final simplification73.8%
(FPCore (x y z t a b c i)
:precision binary64
(if (<= c -4.5e+125)
(* (* c (* b c)) (* i -2.0))
(if (<= c 7.6e+37)
(* (+ (* z t) (* x y)) 2.0)
(* -2.0 (* b (* i (* c c)))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (c <= -4.5e+125) {
tmp = (c * (b * c)) * (i * -2.0);
} else if (c <= 7.6e+37) {
tmp = ((z * t) + (x * y)) * 2.0;
} else {
tmp = -2.0 * (b * (i * (c * c)));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: tmp
if (c <= (-4.5d+125)) then
tmp = (c * (b * c)) * (i * (-2.0d0))
else if (c <= 7.6d+37) then
tmp = ((z * t) + (x * y)) * 2.0d0
else
tmp = (-2.0d0) * (b * (i * (c * c)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (c <= -4.5e+125) {
tmp = (c * (b * c)) * (i * -2.0);
} else if (c <= 7.6e+37) {
tmp = ((z * t) + (x * y)) * 2.0;
} else {
tmp = -2.0 * (b * (i * (c * c)));
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if c <= -4.5e+125: tmp = (c * (b * c)) * (i * -2.0) elif c <= 7.6e+37: tmp = ((z * t) + (x * y)) * 2.0 else: tmp = -2.0 * (b * (i * (c * c))) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (c <= -4.5e+125) tmp = Float64(Float64(c * Float64(b * c)) * Float64(i * -2.0)); elseif (c <= 7.6e+37) tmp = Float64(Float64(Float64(z * t) + Float64(x * y)) * 2.0); else tmp = Float64(-2.0 * Float64(b * Float64(i * Float64(c * c)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if (c <= -4.5e+125) tmp = (c * (b * c)) * (i * -2.0); elseif (c <= 7.6e+37) tmp = ((z * t) + (x * y)) * 2.0; else tmp = -2.0 * (b * (i * (c * c))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[c, -4.5e+125], N[(N[(c * N[(b * c), $MachinePrecision]), $MachinePrecision] * N[(i * -2.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[c, 7.6e+37], N[(N[(N[(z * t), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision], N[(-2.0 * N[(b * N[(i * N[(c * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;c \leq -4.5 \cdot 10^{+125}:\\
\;\;\;\;\left(c \cdot \left(b \cdot c\right)\right) \cdot \left(i \cdot -2\right)\\
\mathbf{elif}\;c \leq 7.6 \cdot 10^{+37}:\\
\;\;\;\;\left(z \cdot t + x \cdot y\right) \cdot 2\\
\mathbf{else}:\\
\;\;\;\;-2 \cdot \left(b \cdot \left(i \cdot \left(c \cdot c\right)\right)\right)\\
\end{array}
\end{array}
if c < -4.5e125Initial program 80.6%
Taylor expanded in b around inf 78.3%
mul-1-neg78.3%
*-commutative78.3%
distribute-rgt-neg-in78.3%
unpow278.3%
distribute-rgt-neg-in78.3%
Simplified78.3%
Taylor expanded in i around 0 78.3%
*-commutative78.3%
unpow278.3%
*-commutative78.3%
associate-*r*81.7%
*-commutative81.7%
associate-*l*81.7%
*-commutative81.7%
associate-*l*84.3%
Simplified84.3%
if -4.5e125 < c < 7.59999999999999979e37Initial program 95.8%
Taylor expanded in c around 0 73.5%
if 7.59999999999999979e37 < c Initial program 80.8%
Taylor expanded in b around inf 66.7%
mul-1-neg66.7%
*-commutative66.7%
distribute-rgt-neg-in66.7%
unpow266.7%
distribute-rgt-neg-in66.7%
Simplified66.7%
Taylor expanded in i around 0 66.7%
unpow266.7%
associate-*r*70.4%
Simplified70.4%
Final simplification74.1%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= t -4.1e-67) (not (<= t 1.1e+50))) (* 2.0 (* z t)) (* 2.0 (* x y))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((t <= -4.1e-67) || !(t <= 1.1e+50)) {
tmp = 2.0 * (z * t);
} else {
tmp = 2.0 * (x * y);
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: tmp
if ((t <= (-4.1d-67)) .or. (.not. (t <= 1.1d+50))) then
tmp = 2.0d0 * (z * t)
else
tmp = 2.0d0 * (x * y)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((t <= -4.1e-67) || !(t <= 1.1e+50)) {
tmp = 2.0 * (z * t);
} else {
tmp = 2.0 * (x * y);
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if (t <= -4.1e-67) or not (t <= 1.1e+50): tmp = 2.0 * (z * t) else: tmp = 2.0 * (x * y) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if ((t <= -4.1e-67) || !(t <= 1.1e+50)) tmp = Float64(2.0 * Float64(z * t)); else tmp = Float64(2.0 * Float64(x * y)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if ((t <= -4.1e-67) || ~((t <= 1.1e+50))) tmp = 2.0 * (z * t); else tmp = 2.0 * (x * y); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[t, -4.1e-67], N[Not[LessEqual[t, 1.1e+50]], $MachinePrecision]], N[(2.0 * N[(z * t), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(x * y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -4.1 \cdot 10^{-67} \lor \neg \left(t \leq 1.1 \cdot 10^{+50}\right):\\
\;\;\;\;2 \cdot \left(z \cdot t\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(x \cdot y\right)\\
\end{array}
\end{array}
if t < -4.0999999999999997e-67 or 1.10000000000000008e50 < t Initial program 87.8%
Taylor expanded in z around inf 51.8%
if -4.0999999999999997e-67 < t < 1.10000000000000008e50Initial program 94.0%
Taylor expanded in x around inf 36.8%
Final simplification44.9%
(FPCore (x y z t a b c i) :precision binary64 (* 2.0 (* z t)))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return 2.0 * (z * t);
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
code = 2.0d0 * (z * t)
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return 2.0 * (z * t);
}
def code(x, y, z, t, a, b, c, i): return 2.0 * (z * t)
function code(x, y, z, t, a, b, c, i) return Float64(2.0 * Float64(z * t)) end
function tmp = code(x, y, z, t, a, b, c, i) tmp = 2.0 * (z * t); end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(2.0 * N[(z * t), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
2 \cdot \left(z \cdot t\right)
\end{array}
Initial program 90.7%
Taylor expanded in z around inf 33.3%
Final simplification33.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 2023187
(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))))