
(FPCore (x y z t a b c i) :precision binary64 (* 2.0 (- (+ (* x y) (* z t)) (* (* (+ a (* b c)) c) i))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return 2.0 * (((x * y) + (z * t)) - (((a + (b * c)) * c) * i));
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
code = 2.0d0 * (((x * y) + (z * t)) - (((a + (b * c)) * c) * i))
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return 2.0 * (((x * y) + (z * t)) - (((a + (b * c)) * c) * i));
}
def code(x, y, z, t, a, b, c, i): return 2.0 * (((x * y) + (z * t)) - (((a + (b * c)) * c) * i))
function code(x, y, z, t, a, b, c, i) return Float64(2.0 * Float64(Float64(Float64(x * y) + Float64(z * t)) - Float64(Float64(Float64(a + Float64(b * c)) * c) * i))) end
function tmp = code(x, y, z, t, a, b, c, i) tmp = 2.0 * (((x * y) + (z * t)) - (((a + (b * c)) * c) * i)); end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(2.0 * N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] - N[(N[(N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision] * c), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
2 \cdot \left(\left(x \cdot y + z \cdot t\right) - \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i\right)
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 16 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a b c i) :precision binary64 (* 2.0 (- (+ (* x y) (* z t)) (* (* (+ a (* b c)) c) i))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return 2.0 * (((x * y) + (z * t)) - (((a + (b * c)) * c) * i));
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
code = 2.0d0 * (((x * y) + (z * t)) - (((a + (b * c)) * c) * i))
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return 2.0 * (((x * y) + (z * t)) - (((a + (b * c)) * c) * i));
}
def code(x, y, z, t, a, b, c, i): return 2.0 * (((x * y) + (z * t)) - (((a + (b * c)) * c) * i))
function code(x, y, z, t, a, b, c, i) return Float64(2.0 * Float64(Float64(Float64(x * y) + Float64(z * t)) - Float64(Float64(Float64(a + Float64(b * c)) * c) * i))) end
function tmp = code(x, y, z, t, a, b, c, i) tmp = 2.0 * (((x * y) + (z * t)) - (((a + (b * c)) * c) * i)); end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(2.0 * N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] - N[(N[(N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision] * c), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
2 \cdot \left(\left(x \cdot y + z \cdot t\right) - \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i\right)
\end{array}
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* c (+ (* b (* c i)) (* a i))))
(t_2 (+ (* x y) (* z t)))
(t_3 (- t_2 (* (* c (+ a (* b c))) i))))
(if (<= t_3 4e+273)
(* t_3 2.0)
(if (<= t_3 INFINITY)
(* 2.0 (- t_2 t_1))
(* 2.0 (* x (- y (/ t_1 x))))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = c * ((b * (c * i)) + (a * i));
double t_2 = (x * y) + (z * t);
double t_3 = t_2 - ((c * (a + (b * c))) * i);
double tmp;
if (t_3 <= 4e+273) {
tmp = t_3 * 2.0;
} else if (t_3 <= ((double) INFINITY)) {
tmp = 2.0 * (t_2 - t_1);
} else {
tmp = 2.0 * (x * (y - (t_1 / x)));
}
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 = c * ((b * (c * i)) + (a * i));
double t_2 = (x * y) + (z * t);
double t_3 = t_2 - ((c * (a + (b * c))) * i);
double tmp;
if (t_3 <= 4e+273) {
tmp = t_3 * 2.0;
} else if (t_3 <= Double.POSITIVE_INFINITY) {
tmp = 2.0 * (t_2 - t_1);
} else {
tmp = 2.0 * (x * (y - (t_1 / x)));
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = c * ((b * (c * i)) + (a * i)) t_2 = (x * y) + (z * t) t_3 = t_2 - ((c * (a + (b * c))) * i) tmp = 0 if t_3 <= 4e+273: tmp = t_3 * 2.0 elif t_3 <= math.inf: tmp = 2.0 * (t_2 - t_1) else: tmp = 2.0 * (x * (y - (t_1 / x))) return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(c * Float64(Float64(b * Float64(c * i)) + Float64(a * i))) t_2 = Float64(Float64(x * y) + Float64(z * t)) t_3 = Float64(t_2 - Float64(Float64(c * Float64(a + Float64(b * c))) * i)) tmp = 0.0 if (t_3 <= 4e+273) tmp = Float64(t_3 * 2.0); elseif (t_3 <= Inf) tmp = Float64(2.0 * Float64(t_2 - t_1)); else tmp = Float64(2.0 * Float64(x * Float64(y - Float64(t_1 / x)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = c * ((b * (c * i)) + (a * i)); t_2 = (x * y) + (z * t); t_3 = t_2 - ((c * (a + (b * c))) * i); tmp = 0.0; if (t_3 <= 4e+273) tmp = t_3 * 2.0; elseif (t_3 <= Inf) tmp = 2.0 * (t_2 - t_1); else tmp = 2.0 * (x * (y - (t_1 / x))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(c * N[(N[(b * N[(c * i), $MachinePrecision]), $MachinePrecision] + N[(a * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(t$95$2 - N[(N[(c * N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$3, 4e+273], N[(t$95$3 * 2.0), $MachinePrecision], If[LessEqual[t$95$3, Infinity], N[(2.0 * N[(t$95$2 - t$95$1), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(x * N[(y - N[(t$95$1 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := c \cdot \left(b \cdot \left(c \cdot i\right) + a \cdot i\right)\\
t_2 := x \cdot y + z \cdot t\\
t_3 := t\_2 - \left(c \cdot \left(a + b \cdot c\right)\right) \cdot i\\
\mathbf{if}\;t\_3 \leq 4 \cdot 10^{+273}:\\
\;\;\;\;t\_3 \cdot 2\\
\mathbf{elif}\;t\_3 \leq \infty:\\
\;\;\;\;2 \cdot \left(t\_2 - t\_1\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(x \cdot \left(y - \frac{t\_1}{x}\right)\right)\\
\end{array}
\end{array}
if (-.f64 (+.f64 (*.f64 x y) (*.f64 z t)) (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i)) < 3.99999999999999978e273Initial program 97.3%
if 3.99999999999999978e273 < (-.f64 (+.f64 (*.f64 x y) (*.f64 z t)) (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i)) < +inf.0Initial program 81.5%
Taylor expanded in c around 0 94.6%
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 c around 0 6.3%
Taylor expanded in x around inf 43.8%
Taylor expanded in t around 0 81.3%
Final simplification95.7%
(FPCore (x y z t a b c i) :precision binary64 (if (<= (- (+ (* x y) (* z t)) (* (* c (+ a (* b c))) i)) INFINITY) (* 2.0 (- (fma x y (* z t)) (* c (* i (fma b c a))))) (* 2.0 (* x (- y (/ (* c (+ (* b (* c i)) (* a i))) x))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((((x * y) + (z * t)) - ((c * (a + (b * c))) * i)) <= ((double) INFINITY)) {
tmp = 2.0 * (fma(x, y, (z * t)) - (c * (i * fma(b, c, a))));
} else {
tmp = 2.0 * (x * (y - ((c * ((b * (c * i)) + (a * i))) / x)));
}
return tmp;
}
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (Float64(Float64(Float64(x * y) + Float64(z * t)) - Float64(Float64(c * Float64(a + Float64(b * c))) * i)) <= Inf) tmp = Float64(2.0 * Float64(fma(x, y, Float64(z * t)) - Float64(c * Float64(i * fma(b, c, a))))); else tmp = Float64(2.0 * Float64(x * Float64(y - Float64(Float64(c * Float64(Float64(b * Float64(c * i)) + Float64(a * i))) / x)))); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] - N[(N[(c * N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision], Infinity], N[(2.0 * N[(N[(x * y + N[(z * t), $MachinePrecision]), $MachinePrecision] - N[(c * N[(i * N[(b * c + a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(x * N[(y - N[(N[(c * N[(N[(b * N[(c * i), $MachinePrecision]), $MachinePrecision] + N[(a * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\left(x \cdot y + z \cdot t\right) - \left(c \cdot \left(a + b \cdot c\right)\right) \cdot i \leq \infty:\\
\;\;\;\;2 \cdot \left(\mathsf{fma}\left(x, y, z \cdot t\right) - c \cdot \left(i \cdot \mathsf{fma}\left(b, c, a\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(x \cdot \left(y - \frac{c \cdot \left(b \cdot \left(c \cdot i\right) + a \cdot i\right)}{x}\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 93.6%
associate--l+93.6%
*-commutative93.6%
associate--l+93.6%
associate--l+93.6%
*-commutative93.6%
associate--l+93.6%
fma-define93.6%
*-commutative93.6%
associate-*l*96.0%
+-commutative96.0%
fma-define96.0%
Simplified96.0%
if +inf.0 < (-.f64 (+.f64 (*.f64 x y) (*.f64 z t)) (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i)) Initial program 0.0%
Taylor expanded in c around 0 6.3%
Taylor expanded in x around inf 43.8%
Taylor expanded in t around 0 81.3%
Final simplification95.0%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ a (* b c))) (t_2 (* (* c t_1) i)))
(if (or (<= t_2 (- INFINITY)) (not (<= t_2 4e+265)))
(* -2.0 (* c (* t_1 i)))
(* (- (+ (* x y) (* z t)) t_2) 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 = (c * t_1) * i;
double tmp;
if ((t_2 <= -((double) INFINITY)) || !(t_2 <= 4e+265)) {
tmp = -2.0 * (c * (t_1 * i));
} else {
tmp = (((x * y) + (z * t)) - t_2) * 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 = (c * t_1) * i;
double tmp;
if ((t_2 <= -Double.POSITIVE_INFINITY) || !(t_2 <= 4e+265)) {
tmp = -2.0 * (c * (t_1 * i));
} else {
tmp = (((x * y) + (z * t)) - t_2) * 2.0;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = a + (b * c) t_2 = (c * t_1) * i tmp = 0 if (t_2 <= -math.inf) or not (t_2 <= 4e+265): tmp = -2.0 * (c * (t_1 * i)) else: tmp = (((x * y) + (z * t)) - t_2) * 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(c * t_1) * i) tmp = 0.0 if ((t_2 <= Float64(-Inf)) || !(t_2 <= 4e+265)) tmp = Float64(-2.0 * Float64(c * Float64(t_1 * i))); else tmp = Float64(Float64(Float64(Float64(x * y) + Float64(z * t)) - t_2) * 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 = (c * t_1) * i; tmp = 0.0; if ((t_2 <= -Inf) || ~((t_2 <= 4e+265))) tmp = -2.0 * (c * (t_1 * i)); else tmp = (((x * y) + (z * t)) - t_2) * 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[(c * t$95$1), $MachinePrecision] * i), $MachinePrecision]}, If[Or[LessEqual[t$95$2, (-Infinity)], N[Not[LessEqual[t$95$2, 4e+265]], $MachinePrecision]], N[(-2.0 * N[(c * N[(t$95$1 * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] - t$95$2), $MachinePrecision] * 2.0), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a + b \cdot c\\
t_2 := \left(c \cdot t\_1\right) \cdot i\\
\mathbf{if}\;t\_2 \leq -\infty \lor \neg \left(t\_2 \leq 4 \cdot 10^{+265}\right):\\
\;\;\;\;-2 \cdot \left(c \cdot \left(t\_1 \cdot i\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\left(x \cdot y + z \cdot t\right) - t\_2\right) \cdot 2\\
\end{array}
\end{array}
if (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < -inf.0 or 4.00000000000000027e265 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) Initial program 70.2%
Taylor expanded in i around inf 88.2%
Taylor expanded in i around 0 88.2%
if -inf.0 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 4.00000000000000027e265Initial program 98.6%
Final simplification94.6%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ a (* b c))) (t_2 (* (* c t_1) i)))
(if (or (<= t_2 -1e+261) (not (<= t_2 4e+265)))
(* -2.0 (* c (* t_1 i)))
(* 2.0 (- (+ (* x y) (* z t)) (* i (* a c)))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = a + (b * c);
double t_2 = (c * t_1) * i;
double tmp;
if ((t_2 <= -1e+261) || !(t_2 <= 4e+265)) {
tmp = -2.0 * (c * (t_1 * i));
} else {
tmp = 2.0 * (((x * y) + (z * t)) - (i * (a * c)));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = a + (b * c)
t_2 = (c * t_1) * i
if ((t_2 <= (-1d+261)) .or. (.not. (t_2 <= 4d+265))) then
tmp = (-2.0d0) * (c * (t_1 * i))
else
tmp = 2.0d0 * (((x * y) + (z * t)) - (i * (a * c)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = a + (b * c);
double t_2 = (c * t_1) * i;
double tmp;
if ((t_2 <= -1e+261) || !(t_2 <= 4e+265)) {
tmp = -2.0 * (c * (t_1 * i));
} else {
tmp = 2.0 * (((x * y) + (z * t)) - (i * (a * c)));
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = a + (b * c) t_2 = (c * t_1) * i tmp = 0 if (t_2 <= -1e+261) or not (t_2 <= 4e+265): tmp = -2.0 * (c * (t_1 * i)) else: tmp = 2.0 * (((x * y) + (z * t)) - (i * (a * c))) return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(a + Float64(b * c)) t_2 = Float64(Float64(c * t_1) * i) tmp = 0.0 if ((t_2 <= -1e+261) || !(t_2 <= 4e+265)) tmp = Float64(-2.0 * Float64(c * Float64(t_1 * i))); else tmp = Float64(2.0 * Float64(Float64(Float64(x * y) + Float64(z * t)) - Float64(i * Float64(a * c)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = a + (b * c); t_2 = (c * t_1) * i; tmp = 0.0; if ((t_2 <= -1e+261) || ~((t_2 <= 4e+265))) tmp = -2.0 * (c * (t_1 * i)); else tmp = 2.0 * (((x * y) + (z * t)) - (i * (a * c))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(c * t$95$1), $MachinePrecision] * i), $MachinePrecision]}, If[Or[LessEqual[t$95$2, -1e+261], N[Not[LessEqual[t$95$2, 4e+265]], $MachinePrecision]], N[(-2.0 * N[(c * N[(t$95$1 * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] - N[(i * N[(a * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a + b \cdot c\\
t_2 := \left(c \cdot t\_1\right) \cdot i\\
\mathbf{if}\;t\_2 \leq -1 \cdot 10^{+261} \lor \neg \left(t\_2 \leq 4 \cdot 10^{+265}\right):\\
\;\;\;\;-2 \cdot \left(c \cdot \left(t\_1 \cdot i\right)\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(\left(x \cdot y + z \cdot t\right) - i \cdot \left(a \cdot c\right)\right)\\
\end{array}
\end{array}
if (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < -9.9999999999999993e260 or 4.00000000000000027e265 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) Initial program 70.8%
Taylor expanded in i around inf 88.4%
Taylor expanded in i around 0 88.4%
if -9.9999999999999993e260 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 4.00000000000000027e265Initial program 98.6%
Taylor expanded in a around inf 93.4%
*-commutative93.4%
Simplified93.4%
Final simplification91.5%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ a (* b c))) (t_2 (* c (* t_1 i))) (t_3 (* (* c t_1) i)))
(if (<= t_3 -2e-63)
(* 2.0 (- (* x y) t_2))
(if (<= t_3 1e+128)
(* (+ (* x y) (* z t)) 2.0)
(* 2.0 (- (* z t) t_2))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = a + (b * c);
double t_2 = c * (t_1 * i);
double t_3 = (c * t_1) * i;
double tmp;
if (t_3 <= -2e-63) {
tmp = 2.0 * ((x * y) - t_2);
} else if (t_3 <= 1e+128) {
tmp = ((x * y) + (z * t)) * 2.0;
} else {
tmp = 2.0 * ((z * t) - t_2);
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: tmp
t_1 = a + (b * c)
t_2 = c * (t_1 * i)
t_3 = (c * t_1) * i
if (t_3 <= (-2d-63)) then
tmp = 2.0d0 * ((x * y) - t_2)
else if (t_3 <= 1d+128) then
tmp = ((x * y) + (z * t)) * 2.0d0
else
tmp = 2.0d0 * ((z * t) - 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 = a + (b * c);
double t_2 = c * (t_1 * i);
double t_3 = (c * t_1) * i;
double tmp;
if (t_3 <= -2e-63) {
tmp = 2.0 * ((x * y) - t_2);
} else if (t_3 <= 1e+128) {
tmp = ((x * y) + (z * t)) * 2.0;
} else {
tmp = 2.0 * ((z * t) - t_2);
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = a + (b * c) t_2 = c * (t_1 * i) t_3 = (c * t_1) * i tmp = 0 if t_3 <= -2e-63: tmp = 2.0 * ((x * y) - t_2) elif t_3 <= 1e+128: tmp = ((x * y) + (z * t)) * 2.0 else: tmp = 2.0 * ((z * t) - t_2) return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(a + Float64(b * c)) t_2 = Float64(c * Float64(t_1 * i)) t_3 = Float64(Float64(c * t_1) * i) tmp = 0.0 if (t_3 <= -2e-63) tmp = Float64(2.0 * Float64(Float64(x * y) - t_2)); elseif (t_3 <= 1e+128) tmp = Float64(Float64(Float64(x * y) + Float64(z * t)) * 2.0); else tmp = Float64(2.0 * Float64(Float64(z * t) - t_2)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = a + (b * c); t_2 = c * (t_1 * i); t_3 = (c * t_1) * i; tmp = 0.0; if (t_3 <= -2e-63) tmp = 2.0 * ((x * y) - t_2); elseif (t_3 <= 1e+128) tmp = ((x * y) + (z * t)) * 2.0; else tmp = 2.0 * ((z * t) - t_2); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(c * N[(t$95$1 * i), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(c * t$95$1), $MachinePrecision] * i), $MachinePrecision]}, If[LessEqual[t$95$3, -2e-63], N[(2.0 * N[(N[(x * y), $MachinePrecision] - t$95$2), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$3, 1e+128], N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision], N[(2.0 * N[(N[(z * t), $MachinePrecision] - t$95$2), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a + b \cdot c\\
t_2 := c \cdot \left(t\_1 \cdot i\right)\\
t_3 := \left(c \cdot t\_1\right) \cdot i\\
\mathbf{if}\;t\_3 \leq -2 \cdot 10^{-63}:\\
\;\;\;\;2 \cdot \left(x \cdot y - t\_2\right)\\
\mathbf{elif}\;t\_3 \leq 10^{+128}:\\
\;\;\;\;\left(x \cdot y + z \cdot t\right) \cdot 2\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(z \cdot t - t\_2\right)\\
\end{array}
\end{array}
if (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < -2.00000000000000013e-63Initial program 78.5%
Taylor expanded in z around 0 81.8%
if -2.00000000000000013e-63 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 1.0000000000000001e128Initial program 98.2%
Taylor expanded in c around 0 92.6%
if 1.0000000000000001e128 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) Initial program 81.6%
Taylor expanded in x around 0 85.0%
Final simplification87.2%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* -2.0 (* c (* (+ a (* b c)) i)))))
(if (<= c -9.6e+78)
t_1
(if (<= c -6.8e-7)
(* 2.0 (- (* z t) (* c (* (* b c) i))))
(if (<= c 2.8e-107)
(* (+ (* x y) (* z t)) 2.0)
(if (<= c 8.6e-75)
(* 2.0 (- (* z t) (* c (* a i))))
(if (<= c 4.2e+47) (* 2.0 (- (* x y) (* a (* 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 * (c * ((a + (b * c)) * i));
double tmp;
if (c <= -9.6e+78) {
tmp = t_1;
} else if (c <= -6.8e-7) {
tmp = 2.0 * ((z * t) - (c * ((b * c) * i)));
} else if (c <= 2.8e-107) {
tmp = ((x * y) + (z * t)) * 2.0;
} else if (c <= 8.6e-75) {
tmp = 2.0 * ((z * t) - (c * (a * i)));
} else if (c <= 4.2e+47) {
tmp = 2.0 * ((x * y) - (a * (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) * (c * ((a + (b * c)) * i))
if (c <= (-9.6d+78)) then
tmp = t_1
else if (c <= (-6.8d-7)) then
tmp = 2.0d0 * ((z * t) - (c * ((b * c) * i)))
else if (c <= 2.8d-107) then
tmp = ((x * y) + (z * t)) * 2.0d0
else if (c <= 8.6d-75) then
tmp = 2.0d0 * ((z * t) - (c * (a * i)))
else if (c <= 4.2d+47) then
tmp = 2.0d0 * ((x * y) - (a * (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 * (c * ((a + (b * c)) * i));
double tmp;
if (c <= -9.6e+78) {
tmp = t_1;
} else if (c <= -6.8e-7) {
tmp = 2.0 * ((z * t) - (c * ((b * c) * i)));
} else if (c <= 2.8e-107) {
tmp = ((x * y) + (z * t)) * 2.0;
} else if (c <= 8.6e-75) {
tmp = 2.0 * ((z * t) - (c * (a * i)));
} else if (c <= 4.2e+47) {
tmp = 2.0 * ((x * y) - (a * (c * i)));
} else {
tmp = t_1;
}
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 <= -9.6e+78: tmp = t_1 elif c <= -6.8e-7: tmp = 2.0 * ((z * t) - (c * ((b * c) * i))) elif c <= 2.8e-107: tmp = ((x * y) + (z * t)) * 2.0 elif c <= 8.6e-75: tmp = 2.0 * ((z * t) - (c * (a * i))) elif c <= 4.2e+47: tmp = 2.0 * ((x * y) - (a * (c * i))) else: tmp = t_1 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 <= -9.6e+78) tmp = t_1; elseif (c <= -6.8e-7) tmp = Float64(2.0 * Float64(Float64(z * t) - Float64(c * Float64(Float64(b * c) * i)))); elseif (c <= 2.8e-107) tmp = Float64(Float64(Float64(x * y) + Float64(z * t)) * 2.0); elseif (c <= 8.6e-75) tmp = Float64(2.0 * Float64(Float64(z * t) - Float64(c * Float64(a * i)))); elseif (c <= 4.2e+47) tmp = Float64(2.0 * Float64(Float64(x * y) - Float64(a * Float64(c * 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 * (c * ((a + (b * c)) * i)); tmp = 0.0; if (c <= -9.6e+78) tmp = t_1; elseif (c <= -6.8e-7) tmp = 2.0 * ((z * t) - (c * ((b * c) * i))); elseif (c <= 2.8e-107) tmp = ((x * y) + (z * t)) * 2.0; elseif (c <= 8.6e-75) tmp = 2.0 * ((z * t) - (c * (a * i))); elseif (c <= 4.2e+47) tmp = 2.0 * ((x * y) - (a * (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[(c * N[(N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[c, -9.6e+78], t$95$1, If[LessEqual[c, -6.8e-7], N[(2.0 * N[(N[(z * t), $MachinePrecision] - N[(c * N[(N[(b * c), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[c, 2.8e-107], N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision], If[LessEqual[c, 8.6e-75], N[(2.0 * N[(N[(z * t), $MachinePrecision] - N[(c * N[(a * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[c, 4.2e+47], N[(2.0 * N[(N[(x * y), $MachinePrecision] - N[(a * N[(c * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]]
\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 -9.6 \cdot 10^{+78}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;c \leq -6.8 \cdot 10^{-7}:\\
\;\;\;\;2 \cdot \left(z \cdot t - c \cdot \left(\left(b \cdot c\right) \cdot i\right)\right)\\
\mathbf{elif}\;c \leq 2.8 \cdot 10^{-107}:\\
\;\;\;\;\left(x \cdot y + z \cdot t\right) \cdot 2\\
\mathbf{elif}\;c \leq 8.6 \cdot 10^{-75}:\\
\;\;\;\;2 \cdot \left(z \cdot t - c \cdot \left(a \cdot i\right)\right)\\
\mathbf{elif}\;c \leq 4.2 \cdot 10^{+47}:\\
\;\;\;\;2 \cdot \left(x \cdot y - a \cdot \left(c \cdot i\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if c < -9.5999999999999994e78 or 4.2e47 < c Initial program 73.9%
Taylor expanded in i around inf 79.8%
Taylor expanded in i around 0 79.8%
if -9.5999999999999994e78 < c < -6.79999999999999948e-7Initial program 95.0%
Taylor expanded in x around 0 85.4%
Taylor expanded in a around 0 80.6%
*-commutative80.6%
Simplified80.6%
if -6.79999999999999948e-7 < c < 2.7999999999999999e-107Initial program 98.0%
Taylor expanded in c around 0 84.4%
if 2.7999999999999999e-107 < c < 8.5999999999999998e-75Initial program 99.7%
Taylor expanded in a around inf 90.7%
*-commutative90.7%
Simplified90.7%
Taylor expanded in x around 0 84.5%
*-commutative84.5%
associate-*r*76.2%
Simplified76.2%
if 8.5999999999999998e-75 < c < 4.2e47Initial program 92.0%
Taylor expanded in a around inf 84.3%
*-commutative84.3%
Simplified84.3%
Taylor expanded in z around 0 76.0%
Final simplification81.2%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* -2.0 (* c (* (* b c) i)))) (t_2 (* (* x y) 2.0)))
(if (<= c -6e-21)
t_1
(if (<= c 3.6e-299)
(* 2.0 (* z t))
(if (<= c 1.15e-106)
t_2
(if (<= c 3.5e-79)
(* -2.0 (* a (* c i)))
(if (<= c 3.5e+47) t_2 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 * (c * ((b * c) * i));
double t_2 = (x * y) * 2.0;
double tmp;
if (c <= -6e-21) {
tmp = t_1;
} else if (c <= 3.6e-299) {
tmp = 2.0 * (z * t);
} else if (c <= 1.15e-106) {
tmp = t_2;
} else if (c <= 3.5e-79) {
tmp = -2.0 * (a * (c * i));
} else if (c <= 3.5e+47) {
tmp = t_2;
} 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) :: t_2
real(8) :: tmp
t_1 = (-2.0d0) * (c * ((b * c) * i))
t_2 = (x * y) * 2.0d0
if (c <= (-6d-21)) then
tmp = t_1
else if (c <= 3.6d-299) then
tmp = 2.0d0 * (z * t)
else if (c <= 1.15d-106) then
tmp = t_2
else if (c <= 3.5d-79) then
tmp = (-2.0d0) * (a * (c * i))
else if (c <= 3.5d+47) then
tmp = t_2
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 * (c * ((b * c) * i));
double t_2 = (x * y) * 2.0;
double tmp;
if (c <= -6e-21) {
tmp = t_1;
} else if (c <= 3.6e-299) {
tmp = 2.0 * (z * t);
} else if (c <= 1.15e-106) {
tmp = t_2;
} else if (c <= 3.5e-79) {
tmp = -2.0 * (a * (c * i));
} else if (c <= 3.5e+47) {
tmp = t_2;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = -2.0 * (c * ((b * c) * i)) t_2 = (x * y) * 2.0 tmp = 0 if c <= -6e-21: tmp = t_1 elif c <= 3.6e-299: tmp = 2.0 * (z * t) elif c <= 1.15e-106: tmp = t_2 elif c <= 3.5e-79: tmp = -2.0 * (a * (c * i)) elif c <= 3.5e+47: tmp = t_2 else: tmp = t_1 return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(-2.0 * Float64(c * Float64(Float64(b * c) * i))) t_2 = Float64(Float64(x * y) * 2.0) tmp = 0.0 if (c <= -6e-21) tmp = t_1; elseif (c <= 3.6e-299) tmp = Float64(2.0 * Float64(z * t)); elseif (c <= 1.15e-106) tmp = t_2; elseif (c <= 3.5e-79) tmp = Float64(-2.0 * Float64(a * Float64(c * i))); elseif (c <= 3.5e+47) tmp = t_2; else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = -2.0 * (c * ((b * c) * i)); t_2 = (x * y) * 2.0; tmp = 0.0; if (c <= -6e-21) tmp = t_1; elseif (c <= 3.6e-299) tmp = 2.0 * (z * t); elseif (c <= 1.15e-106) tmp = t_2; elseif (c <= 3.5e-79) tmp = -2.0 * (a * (c * i)); elseif (c <= 3.5e+47) tmp = t_2; 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[(c * N[(N[(b * c), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x * y), $MachinePrecision] * 2.0), $MachinePrecision]}, If[LessEqual[c, -6e-21], t$95$1, If[LessEqual[c, 3.6e-299], N[(2.0 * N[(z * t), $MachinePrecision]), $MachinePrecision], If[LessEqual[c, 1.15e-106], t$95$2, If[LessEqual[c, 3.5e-79], N[(-2.0 * N[(a * N[(c * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[c, 3.5e+47], t$95$2, t$95$1]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := -2 \cdot \left(c \cdot \left(\left(b \cdot c\right) \cdot i\right)\right)\\
t_2 := \left(x \cdot y\right) \cdot 2\\
\mathbf{if}\;c \leq -6 \cdot 10^{-21}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;c \leq 3.6 \cdot 10^{-299}:\\
\;\;\;\;2 \cdot \left(z \cdot t\right)\\
\mathbf{elif}\;c \leq 1.15 \cdot 10^{-106}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;c \leq 3.5 \cdot 10^{-79}:\\
\;\;\;\;-2 \cdot \left(a \cdot \left(c \cdot i\right)\right)\\
\mathbf{elif}\;c \leq 3.5 \cdot 10^{+47}:\\
\;\;\;\;t\_2\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if c < -5.99999999999999982e-21 or 3.50000000000000015e47 < c Initial program 77.6%
Taylor expanded in i around inf 75.3%
Taylor expanded in i around 0 75.3%
Taylor expanded in a around 0 60.4%
*-commutative69.1%
Simplified60.4%
if -5.99999999999999982e-21 < c < 3.6e-299Initial program 99.9%
Taylor expanded in z around inf 48.6%
if 3.6e-299 < c < 1.15e-106 or 3.5000000000000003e-79 < c < 3.50000000000000015e47Initial program 93.7%
Taylor expanded in x around inf 53.5%
if 1.15e-106 < c < 3.5000000000000003e-79Initial program 99.7%
Taylor expanded in i around inf 54.3%
Taylor expanded in c around 0 53.8%
*-commutative53.8%
Simplified53.8%
Final simplification55.6%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* 2.0 (* z t))) (t_2 (* (* x y) 2.0)))
(if (<= (* x y) -4.2e-27)
t_2
(if (<= (* x y) 2.2e-171)
t_1
(if (<= (* x y) 2.8e-36)
(* -2.0 (* a (* c i)))
(if (<= (* x y) 2.1e+27) t_1 t_2))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = 2.0 * (z * t);
double t_2 = (x * y) * 2.0;
double tmp;
if ((x * y) <= -4.2e-27) {
tmp = t_2;
} else if ((x * y) <= 2.2e-171) {
tmp = t_1;
} else if ((x * y) <= 2.8e-36) {
tmp = -2.0 * (a * (c * i));
} else if ((x * y) <= 2.1e+27) {
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 * (z * t)
t_2 = (x * y) * 2.0d0
if ((x * y) <= (-4.2d-27)) then
tmp = t_2
else if ((x * y) <= 2.2d-171) then
tmp = t_1
else if ((x * y) <= 2.8d-36) then
tmp = (-2.0d0) * (a * (c * i))
else if ((x * y) <= 2.1d+27) then
tmp = t_1
else
tmp = t_2
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = 2.0 * (z * t);
double t_2 = (x * y) * 2.0;
double tmp;
if ((x * y) <= -4.2e-27) {
tmp = t_2;
} else if ((x * y) <= 2.2e-171) {
tmp = t_1;
} else if ((x * y) <= 2.8e-36) {
tmp = -2.0 * (a * (c * i));
} else if ((x * y) <= 2.1e+27) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = 2.0 * (z * t) t_2 = (x * y) * 2.0 tmp = 0 if (x * y) <= -4.2e-27: tmp = t_2 elif (x * y) <= 2.2e-171: tmp = t_1 elif (x * y) <= 2.8e-36: tmp = -2.0 * (a * (c * i)) elif (x * y) <= 2.1e+27: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(2.0 * Float64(z * t)) t_2 = Float64(Float64(x * y) * 2.0) tmp = 0.0 if (Float64(x * y) <= -4.2e-27) tmp = t_2; elseif (Float64(x * y) <= 2.2e-171) tmp = t_1; elseif (Float64(x * y) <= 2.8e-36) tmp = Float64(-2.0 * Float64(a * Float64(c * i))); elseif (Float64(x * y) <= 2.1e+27) tmp = t_1; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = 2.0 * (z * t); t_2 = (x * y) * 2.0; tmp = 0.0; if ((x * y) <= -4.2e-27) tmp = t_2; elseif ((x * y) <= 2.2e-171) tmp = t_1; elseif ((x * y) <= 2.8e-36) tmp = -2.0 * (a * (c * i)); elseif ((x * y) <= 2.1e+27) tmp = t_1; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(2.0 * N[(z * t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x * y), $MachinePrecision] * 2.0), $MachinePrecision]}, If[LessEqual[N[(x * y), $MachinePrecision], -4.2e-27], t$95$2, If[LessEqual[N[(x * y), $MachinePrecision], 2.2e-171], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], 2.8e-36], N[(-2.0 * N[(a * N[(c * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 2.1e+27], t$95$1, t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := 2 \cdot \left(z \cdot t\right)\\
t_2 := \left(x \cdot y\right) \cdot 2\\
\mathbf{if}\;x \cdot y \leq -4.2 \cdot 10^{-27}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;x \cdot y \leq 2.2 \cdot 10^{-171}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \cdot y \leq 2.8 \cdot 10^{-36}:\\
\;\;\;\;-2 \cdot \left(a \cdot \left(c \cdot i\right)\right)\\
\mathbf{elif}\;x \cdot y \leq 2.1 \cdot 10^{+27}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if (*.f64 x y) < -4.20000000000000031e-27 or 2.09999999999999995e27 < (*.f64 x y) Initial program 85.8%
Taylor expanded in x around inf 56.3%
if -4.20000000000000031e-27 < (*.f64 x y) < 2.2000000000000001e-171 or 2.8000000000000001e-36 < (*.f64 x y) < 2.09999999999999995e27Initial program 88.5%
Taylor expanded in z around inf 47.2%
if 2.2000000000000001e-171 < (*.f64 x y) < 2.8000000000000001e-36Initial program 95.0%
Taylor expanded in i around inf 74.1%
Taylor expanded in c around 0 58.6%
*-commutative58.6%
Simplified58.6%
Final simplification52.3%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* 2.0 (* z t))) (t_2 (* (* x y) 2.0)))
(if (<= (* x y) -4.2e-25)
t_2
(if (<= (* x y) 5.5e-168)
t_1
(if (<= (* x y) 1.2e-35)
(* c (* -2.0 (* a i)))
(if (<= (* x y) 4.8e+29) t_1 t_2))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = 2.0 * (z * t);
double t_2 = (x * y) * 2.0;
double tmp;
if ((x * y) <= -4.2e-25) {
tmp = t_2;
} else if ((x * y) <= 5.5e-168) {
tmp = t_1;
} else if ((x * y) <= 1.2e-35) {
tmp = c * (-2.0 * (a * i));
} else if ((x * y) <= 4.8e+29) {
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 * (z * t)
t_2 = (x * y) * 2.0d0
if ((x * y) <= (-4.2d-25)) then
tmp = t_2
else if ((x * y) <= 5.5d-168) then
tmp = t_1
else if ((x * y) <= 1.2d-35) then
tmp = c * ((-2.0d0) * (a * i))
else if ((x * y) <= 4.8d+29) then
tmp = t_1
else
tmp = t_2
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = 2.0 * (z * t);
double t_2 = (x * y) * 2.0;
double tmp;
if ((x * y) <= -4.2e-25) {
tmp = t_2;
} else if ((x * y) <= 5.5e-168) {
tmp = t_1;
} else if ((x * y) <= 1.2e-35) {
tmp = c * (-2.0 * (a * i));
} else if ((x * y) <= 4.8e+29) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = 2.0 * (z * t) t_2 = (x * y) * 2.0 tmp = 0 if (x * y) <= -4.2e-25: tmp = t_2 elif (x * y) <= 5.5e-168: tmp = t_1 elif (x * y) <= 1.2e-35: tmp = c * (-2.0 * (a * i)) elif (x * y) <= 4.8e+29: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(2.0 * Float64(z * t)) t_2 = Float64(Float64(x * y) * 2.0) tmp = 0.0 if (Float64(x * y) <= -4.2e-25) tmp = t_2; elseif (Float64(x * y) <= 5.5e-168) tmp = t_1; elseif (Float64(x * y) <= 1.2e-35) tmp = Float64(c * Float64(-2.0 * Float64(a * i))); elseif (Float64(x * y) <= 4.8e+29) tmp = t_1; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = 2.0 * (z * t); t_2 = (x * y) * 2.0; tmp = 0.0; if ((x * y) <= -4.2e-25) tmp = t_2; elseif ((x * y) <= 5.5e-168) tmp = t_1; elseif ((x * y) <= 1.2e-35) tmp = c * (-2.0 * (a * i)); elseif ((x * y) <= 4.8e+29) tmp = t_1; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(2.0 * N[(z * t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x * y), $MachinePrecision] * 2.0), $MachinePrecision]}, If[LessEqual[N[(x * y), $MachinePrecision], -4.2e-25], t$95$2, If[LessEqual[N[(x * y), $MachinePrecision], 5.5e-168], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], 1.2e-35], N[(c * N[(-2.0 * N[(a * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 4.8e+29], t$95$1, t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := 2 \cdot \left(z \cdot t\right)\\
t_2 := \left(x \cdot y\right) \cdot 2\\
\mathbf{if}\;x \cdot y \leq -4.2 \cdot 10^{-25}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;x \cdot y \leq 5.5 \cdot 10^{-168}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \cdot y \leq 1.2 \cdot 10^{-35}:\\
\;\;\;\;c \cdot \left(-2 \cdot \left(a \cdot i\right)\right)\\
\mathbf{elif}\;x \cdot y \leq 4.8 \cdot 10^{+29}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if (*.f64 x y) < -4.20000000000000005e-25 or 4.8000000000000002e29 < (*.f64 x y) Initial program 85.8%
Taylor expanded in x around inf 56.3%
if -4.20000000000000005e-25 < (*.f64 x y) < 5.4999999999999999e-168 or 1.2000000000000001e-35 < (*.f64 x y) < 4.8000000000000002e29Initial program 88.5%
Taylor expanded in z around inf 47.2%
if 5.4999999999999999e-168 < (*.f64 x y) < 1.2000000000000001e-35Initial program 95.0%
Taylor expanded in i around inf 74.1%
Taylor expanded in i around 0 74.1%
Taylor expanded in c around 0 58.6%
*-commutative58.6%
*-commutative58.6%
associate-*l*53.6%
*-commutative53.6%
associate-*r*53.6%
*-commutative53.6%
Simplified53.6%
Final simplification51.9%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* -2.0 (* c (* (+ a (* b c)) i)))))
(if (<= c -1.45e-7)
t_1
(if (<= c 1.15e-106)
(* (+ (* x y) (* z t)) 2.0)
(if (<= c 4.2e-75)
(* 2.0 (- (* z t) (* c (* a i))))
(if (<= c 3.5e+47) (* 2.0 (- (* x y) (* a (* 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 * (c * ((a + (b * c)) * i));
double tmp;
if (c <= -1.45e-7) {
tmp = t_1;
} else if (c <= 1.15e-106) {
tmp = ((x * y) + (z * t)) * 2.0;
} else if (c <= 4.2e-75) {
tmp = 2.0 * ((z * t) - (c * (a * i)));
} else if (c <= 3.5e+47) {
tmp = 2.0 * ((x * y) - (a * (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) * (c * ((a + (b * c)) * i))
if (c <= (-1.45d-7)) then
tmp = t_1
else if (c <= 1.15d-106) then
tmp = ((x * y) + (z * t)) * 2.0d0
else if (c <= 4.2d-75) then
tmp = 2.0d0 * ((z * t) - (c * (a * i)))
else if (c <= 3.5d+47) then
tmp = 2.0d0 * ((x * y) - (a * (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 * (c * ((a + (b * c)) * i));
double tmp;
if (c <= -1.45e-7) {
tmp = t_1;
} else if (c <= 1.15e-106) {
tmp = ((x * y) + (z * t)) * 2.0;
} else if (c <= 4.2e-75) {
tmp = 2.0 * ((z * t) - (c * (a * i)));
} else if (c <= 3.5e+47) {
tmp = 2.0 * ((x * y) - (a * (c * i)));
} else {
tmp = t_1;
}
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 <= -1.45e-7: tmp = t_1 elif c <= 1.15e-106: tmp = ((x * y) + (z * t)) * 2.0 elif c <= 4.2e-75: tmp = 2.0 * ((z * t) - (c * (a * i))) elif c <= 3.5e+47: tmp = 2.0 * ((x * y) - (a * (c * i))) else: tmp = t_1 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 <= -1.45e-7) tmp = t_1; elseif (c <= 1.15e-106) tmp = Float64(Float64(Float64(x * y) + Float64(z * t)) * 2.0); elseif (c <= 4.2e-75) tmp = Float64(2.0 * Float64(Float64(z * t) - Float64(c * Float64(a * i)))); elseif (c <= 3.5e+47) tmp = Float64(2.0 * Float64(Float64(x * y) - Float64(a * Float64(c * 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 * (c * ((a + (b * c)) * i)); tmp = 0.0; if (c <= -1.45e-7) tmp = t_1; elseif (c <= 1.15e-106) tmp = ((x * y) + (z * t)) * 2.0; elseif (c <= 4.2e-75) tmp = 2.0 * ((z * t) - (c * (a * i))); elseif (c <= 3.5e+47) tmp = 2.0 * ((x * y) - (a * (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[(c * N[(N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[c, -1.45e-7], t$95$1, If[LessEqual[c, 1.15e-106], N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision], If[LessEqual[c, 4.2e-75], N[(2.0 * N[(N[(z * t), $MachinePrecision] - N[(c * N[(a * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[c, 3.5e+47], N[(2.0 * N[(N[(x * y), $MachinePrecision] - N[(a * N[(c * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]
\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 -1.45 \cdot 10^{-7}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;c \leq 1.15 \cdot 10^{-106}:\\
\;\;\;\;\left(x \cdot y + z \cdot t\right) \cdot 2\\
\mathbf{elif}\;c \leq 4.2 \cdot 10^{-75}:\\
\;\;\;\;2 \cdot \left(z \cdot t - c \cdot \left(a \cdot i\right)\right)\\
\mathbf{elif}\;c \leq 3.5 \cdot 10^{+47}:\\
\;\;\;\;2 \cdot \left(x \cdot y - a \cdot \left(c \cdot i\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if c < -1.4499999999999999e-7 or 3.50000000000000015e47 < c Initial program 77.4%
Taylor expanded in i around inf 75.9%
Taylor expanded in i around 0 75.9%
if -1.4499999999999999e-7 < c < 1.15e-106Initial program 98.0%
Taylor expanded in c around 0 84.4%
if 1.15e-106 < c < 4.2000000000000002e-75Initial program 99.7%
Taylor expanded in a around inf 90.7%
*-commutative90.7%
Simplified90.7%
Taylor expanded in x around 0 84.5%
*-commutative84.5%
associate-*r*76.2%
Simplified76.2%
if 4.2000000000000002e-75 < c < 3.50000000000000015e47Initial program 92.0%
Taylor expanded in a around inf 84.3%
*-commutative84.3%
Simplified84.3%
Taylor expanded in z around 0 76.0%
Final simplification79.3%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* (+ (* x y) (* z t)) 2.0))
(t_2 (* -2.0 (* c (* (+ a (* b c)) i)))))
(if (<= c -8.8e-7)
t_2
(if (<= c 1.15e-106)
t_1
(if (<= c 1.15e-79)
(* 2.0 (- (* z t) (* c (* a i))))
(if (<= c 3e+46) t_1 t_2))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = ((x * y) + (z * t)) * 2.0;
double t_2 = -2.0 * (c * ((a + (b * c)) * i));
double tmp;
if (c <= -8.8e-7) {
tmp = t_2;
} else if (c <= 1.15e-106) {
tmp = t_1;
} else if (c <= 1.15e-79) {
tmp = 2.0 * ((z * t) - (c * (a * i)));
} else if (c <= 3e+46) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = ((x * y) + (z * t)) * 2.0d0
t_2 = (-2.0d0) * (c * ((a + (b * c)) * i))
if (c <= (-8.8d-7)) then
tmp = t_2
else if (c <= 1.15d-106) then
tmp = t_1
else if (c <= 1.15d-79) then
tmp = 2.0d0 * ((z * t) - (c * (a * i)))
else if (c <= 3d+46) then
tmp = t_1
else
tmp = t_2
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = ((x * y) + (z * t)) * 2.0;
double t_2 = -2.0 * (c * ((a + (b * c)) * i));
double tmp;
if (c <= -8.8e-7) {
tmp = t_2;
} else if (c <= 1.15e-106) {
tmp = t_1;
} else if (c <= 1.15e-79) {
tmp = 2.0 * ((z * t) - (c * (a * i)));
} else if (c <= 3e+46) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = ((x * y) + (z * t)) * 2.0 t_2 = -2.0 * (c * ((a + (b * c)) * i)) tmp = 0 if c <= -8.8e-7: tmp = t_2 elif c <= 1.15e-106: tmp = t_1 elif c <= 1.15e-79: tmp = 2.0 * ((z * t) - (c * (a * i))) elif c <= 3e+46: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(Float64(Float64(x * y) + Float64(z * t)) * 2.0) t_2 = Float64(-2.0 * Float64(c * Float64(Float64(a + Float64(b * c)) * i))) tmp = 0.0 if (c <= -8.8e-7) tmp = t_2; elseif (c <= 1.15e-106) tmp = t_1; elseif (c <= 1.15e-79) tmp = Float64(2.0 * Float64(Float64(z * t) - Float64(c * Float64(a * i)))); elseif (c <= 3e+46) tmp = t_1; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = ((x * y) + (z * t)) * 2.0; t_2 = -2.0 * (c * ((a + (b * c)) * i)); tmp = 0.0; if (c <= -8.8e-7) tmp = t_2; elseif (c <= 1.15e-106) tmp = t_1; elseif (c <= 1.15e-79) tmp = 2.0 * ((z * t) - (c * (a * i))); elseif (c <= 3e+46) tmp = t_1; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision]}, Block[{t$95$2 = N[(-2.0 * N[(c * N[(N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[c, -8.8e-7], t$95$2, If[LessEqual[c, 1.15e-106], t$95$1, If[LessEqual[c, 1.15e-79], N[(2.0 * N[(N[(z * t), $MachinePrecision] - N[(c * N[(a * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[c, 3e+46], t$95$1, t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(x \cdot y + z \cdot t\right) \cdot 2\\
t_2 := -2 \cdot \left(c \cdot \left(\left(a + b \cdot c\right) \cdot i\right)\right)\\
\mathbf{if}\;c \leq -8.8 \cdot 10^{-7}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;c \leq 1.15 \cdot 10^{-106}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;c \leq 1.15 \cdot 10^{-79}:\\
\;\;\;\;2 \cdot \left(z \cdot t - c \cdot \left(a \cdot i\right)\right)\\
\mathbf{elif}\;c \leq 3 \cdot 10^{+46}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if c < -8.8000000000000004e-7 or 3.00000000000000023e46 < c Initial program 77.6%
Taylor expanded in i around inf 76.1%
Taylor expanded in i around 0 76.1%
if -8.8000000000000004e-7 < c < 1.15e-106 or 1.15000000000000006e-79 < c < 3.00000000000000023e46Initial program 96.8%
Taylor expanded in c around 0 81.9%
if 1.15e-106 < c < 1.15000000000000006e-79Initial program 99.7%
Taylor expanded in a around inf 89.8%
*-commutative89.8%
Simplified89.8%
Taylor expanded in x around 0 83.0%
*-commutative83.0%
associate-*r*73.8%
Simplified73.8%
Final simplification78.8%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= (* x y) -4e-11) (not (<= (* x y) 5e+71))) (* 2.0 (* y (- x (/ (* a (* c i)) y)))) (* 2.0 (- (* z t) (* c (* (+ a (* b c)) i))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (((x * y) <= -4e-11) || !((x * y) <= 5e+71)) {
tmp = 2.0 * (y * (x - ((a * (c * i)) / y)));
} else {
tmp = 2.0 * ((z * t) - (c * ((a + (b * c)) * i)));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: tmp
if (((x * y) <= (-4d-11)) .or. (.not. ((x * y) <= 5d+71))) then
tmp = 2.0d0 * (y * (x - ((a * (c * i)) / y)))
else
tmp = 2.0d0 * ((z * t) - (c * ((a + (b * c)) * i)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (((x * y) <= -4e-11) || !((x * y) <= 5e+71)) {
tmp = 2.0 * (y * (x - ((a * (c * i)) / y)));
} else {
tmp = 2.0 * ((z * t) - (c * ((a + (b * c)) * i)));
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if ((x * y) <= -4e-11) or not ((x * y) <= 5e+71): tmp = 2.0 * (y * (x - ((a * (c * i)) / y))) else: tmp = 2.0 * ((z * t) - (c * ((a + (b * c)) * i))) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if ((Float64(x * y) <= -4e-11) || !(Float64(x * y) <= 5e+71)) tmp = Float64(2.0 * Float64(y * Float64(x - Float64(Float64(a * Float64(c * i)) / y)))); else tmp = Float64(2.0 * Float64(Float64(z * t) - Float64(c * Float64(Float64(a + Float64(b * c)) * i)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if (((x * y) <= -4e-11) || ~(((x * y) <= 5e+71))) tmp = 2.0 * (y * (x - ((a * (c * i)) / y))); else tmp = 2.0 * ((z * t) - (c * ((a + (b * c)) * i))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[N[(x * y), $MachinePrecision], -4e-11], N[Not[LessEqual[N[(x * y), $MachinePrecision], 5e+71]], $MachinePrecision]], N[(2.0 * N[(y * N[(x - N[(N[(a * N[(c * i), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[(z * t), $MachinePrecision] - N[(c * N[(N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \cdot y \leq -4 \cdot 10^{-11} \lor \neg \left(x \cdot y \leq 5 \cdot 10^{+71}\right):\\
\;\;\;\;2 \cdot \left(y \cdot \left(x - \frac{a \cdot \left(c \cdot i\right)}{y}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(z \cdot t - c \cdot \left(\left(a + b \cdot c\right) \cdot i\right)\right)\\
\end{array}
\end{array}
if (*.f64 x y) < -3.99999999999999976e-11 or 4.99999999999999972e71 < (*.f64 x y) Initial program 84.9%
Taylor expanded in a around inf 76.2%
*-commutative76.2%
Simplified76.2%
Taylor expanded in y around inf 77.3%
Taylor expanded in t around 0 71.8%
if -3.99999999999999976e-11 < (*.f64 x y) < 4.99999999999999972e71Initial program 89.9%
Taylor expanded in x around 0 88.1%
Final simplification81.0%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= c -1.15e-7) (not (<= c 2.15e+46))) (* -2.0 (* c (* (+ a (* b c)) i))) (* (+ (* x y) (* z t)) 2.0)))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((c <= -1.15e-7) || !(c <= 2.15e+46)) {
tmp = -2.0 * (c * ((a + (b * c)) * i));
} else {
tmp = ((x * y) + (z * t)) * 2.0;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: tmp
if ((c <= (-1.15d-7)) .or. (.not. (c <= 2.15d+46))) then
tmp = (-2.0d0) * (c * ((a + (b * c)) * i))
else
tmp = ((x * y) + (z * t)) * 2.0d0
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((c <= -1.15e-7) || !(c <= 2.15e+46)) {
tmp = -2.0 * (c * ((a + (b * c)) * i));
} else {
tmp = ((x * y) + (z * t)) * 2.0;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if (c <= -1.15e-7) or not (c <= 2.15e+46): tmp = -2.0 * (c * ((a + (b * c)) * i)) else: tmp = ((x * y) + (z * t)) * 2.0 return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if ((c <= -1.15e-7) || !(c <= 2.15e+46)) tmp = Float64(-2.0 * Float64(c * Float64(Float64(a + Float64(b * c)) * i))); else tmp = Float64(Float64(Float64(x * y) + Float64(z * t)) * 2.0); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if ((c <= -1.15e-7) || ~((c <= 2.15e+46))) tmp = -2.0 * (c * ((a + (b * c)) * i)); else tmp = ((x * y) + (z * t)) * 2.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[c, -1.15e-7], N[Not[LessEqual[c, 2.15e+46]], $MachinePrecision]], N[(-2.0 * N[(c * N[(N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;c \leq -1.15 \cdot 10^{-7} \lor \neg \left(c \leq 2.15 \cdot 10^{+46}\right):\\
\;\;\;\;-2 \cdot \left(c \cdot \left(\left(a + b \cdot c\right) \cdot i\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(x \cdot y + z \cdot t\right) \cdot 2\\
\end{array}
\end{array}
if c < -1.14999999999999997e-7 or 2.15000000000000002e46 < c Initial program 77.6%
Taylor expanded in i around inf 76.1%
Taylor expanded in i around 0 76.1%
if -1.14999999999999997e-7 < c < 2.15000000000000002e46Initial program 97.0%
Taylor expanded in c around 0 78.2%
Final simplification77.2%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= c -1.02e+110) (not (<= c 6.8e+112))) (* -2.0 (* c (* (* b c) i))) (* (+ (* x y) (* z t)) 2.0)))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((c <= -1.02e+110) || !(c <= 6.8e+112)) {
tmp = -2.0 * (c * ((b * c) * i));
} else {
tmp = ((x * y) + (z * t)) * 2.0;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: tmp
if ((c <= (-1.02d+110)) .or. (.not. (c <= 6.8d+112))) then
tmp = (-2.0d0) * (c * ((b * c) * i))
else
tmp = ((x * y) + (z * t)) * 2.0d0
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((c <= -1.02e+110) || !(c <= 6.8e+112)) {
tmp = -2.0 * (c * ((b * c) * i));
} else {
tmp = ((x * y) + (z * t)) * 2.0;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if (c <= -1.02e+110) or not (c <= 6.8e+112): tmp = -2.0 * (c * ((b * c) * i)) else: tmp = ((x * y) + (z * t)) * 2.0 return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if ((c <= -1.02e+110) || !(c <= 6.8e+112)) tmp = Float64(-2.0 * Float64(c * Float64(Float64(b * c) * i))); else tmp = Float64(Float64(Float64(x * y) + Float64(z * t)) * 2.0); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if ((c <= -1.02e+110) || ~((c <= 6.8e+112))) tmp = -2.0 * (c * ((b * c) * i)); else tmp = ((x * y) + (z * t)) * 2.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[c, -1.02e+110], N[Not[LessEqual[c, 6.8e+112]], $MachinePrecision]], N[(-2.0 * N[(c * N[(N[(b * c), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;c \leq -1.02 \cdot 10^{+110} \lor \neg \left(c \leq 6.8 \cdot 10^{+112}\right):\\
\;\;\;\;-2 \cdot \left(c \cdot \left(\left(b \cdot c\right) \cdot i\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(x \cdot y + z \cdot t\right) \cdot 2\\
\end{array}
\end{array}
if c < -1.02e110 or 6.79999999999999987e112 < c Initial program 72.3%
Taylor expanded in i around inf 82.7%
Taylor expanded in i around 0 82.7%
Taylor expanded in a around 0 68.0%
*-commutative68.9%
Simplified68.0%
if -1.02e110 < c < 6.79999999999999987e112Initial program 95.3%
Taylor expanded in c around 0 71.8%
Final simplification70.5%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= (* x y) -1.45e-16) (not (<= (* x y) 3.8e+26))) (* (* x y) 2.0) (* 2.0 (* z t))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (((x * y) <= -1.45e-16) || !((x * y) <= 3.8e+26)) {
tmp = (x * y) * 2.0;
} else {
tmp = 2.0 * (z * t);
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: tmp
if (((x * y) <= (-1.45d-16)) .or. (.not. ((x * y) <= 3.8d+26))) then
tmp = (x * y) * 2.0d0
else
tmp = 2.0d0 * (z * t)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (((x * y) <= -1.45e-16) || !((x * y) <= 3.8e+26)) {
tmp = (x * y) * 2.0;
} else {
tmp = 2.0 * (z * t);
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if ((x * y) <= -1.45e-16) or not ((x * y) <= 3.8e+26): tmp = (x * y) * 2.0 else: tmp = 2.0 * (z * t) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if ((Float64(x * y) <= -1.45e-16) || !(Float64(x * y) <= 3.8e+26)) tmp = Float64(Float64(x * y) * 2.0); else tmp = Float64(2.0 * Float64(z * t)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if (((x * y) <= -1.45e-16) || ~(((x * y) <= 3.8e+26))) tmp = (x * y) * 2.0; else tmp = 2.0 * (z * t); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[N[(x * y), $MachinePrecision], -1.45e-16], N[Not[LessEqual[N[(x * y), $MachinePrecision], 3.8e+26]], $MachinePrecision]], N[(N[(x * y), $MachinePrecision] * 2.0), $MachinePrecision], N[(2.0 * N[(z * t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \cdot y \leq -1.45 \cdot 10^{-16} \lor \neg \left(x \cdot y \leq 3.8 \cdot 10^{+26}\right):\\
\;\;\;\;\left(x \cdot y\right) \cdot 2\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(z \cdot t\right)\\
\end{array}
\end{array}
if (*.f64 x y) < -1.4499999999999999e-16 or 3.8000000000000002e26 < (*.f64 x y) Initial program 85.8%
Taylor expanded in x around inf 56.3%
if -1.4499999999999999e-16 < (*.f64 x y) < 3.8000000000000002e26Initial program 89.4%
Taylor expanded in z around inf 44.5%
Final simplification50.0%
(FPCore (x y z t a b c i) :precision binary64 (* 2.0 (* z t)))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return 2.0 * (z * t);
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
code = 2.0d0 * (z * t)
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return 2.0 * (z * t);
}
def code(x, y, z, t, a, b, c, i): return 2.0 * (z * t)
function code(x, y, z, t, a, b, c, i) return Float64(2.0 * Float64(z * t)) end
function tmp = code(x, y, z, t, a, b, c, i) tmp = 2.0 * (z * t); end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(2.0 * N[(z * t), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
2 \cdot \left(z \cdot t\right)
\end{array}
Initial program 87.8%
Taylor expanded in z around inf 30.5%
Final simplification30.5%
(FPCore (x y z t a b c i) :precision binary64 (* 2.0 (- (+ (* x y) (* z t)) (* (+ a (* b c)) (* c i)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return 2.0 * (((x * y) + (z * t)) - ((a + (b * c)) * (c * i)));
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
code = 2.0d0 * (((x * y) + (z * t)) - ((a + (b * c)) * (c * i)))
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return 2.0 * (((x * y) + (z * t)) - ((a + (b * c)) * (c * i)));
}
def code(x, y, z, t, a, b, c, i): return 2.0 * (((x * y) + (z * t)) - ((a + (b * c)) * (c * i)))
function code(x, y, z, t, a, b, c, i) return Float64(2.0 * Float64(Float64(Float64(x * y) + Float64(z * t)) - Float64(Float64(a + Float64(b * c)) * Float64(c * i)))) end
function tmp = code(x, y, z, t, a, b, c, i) tmp = 2.0 * (((x * y) + (z * t)) - ((a + (b * c)) * (c * i))); end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(2.0 * N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] - N[(N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision] * N[(c * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
2 \cdot \left(\left(x \cdot y + z \cdot t\right) - \left(a + b \cdot c\right) \cdot \left(c \cdot i\right)\right)
\end{array}
herbie shell --seed 2024096
(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))))