
(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 13 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a b c i) :precision binary64 (* 2.0 (- (+ (* x y) (* z t)) (* (* (+ a (* b c)) c) i))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return 2.0 * (((x * y) + (z * t)) - (((a + (b * c)) * c) * i));
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
code = 2.0d0 * (((x * y) + (z * t)) - (((a + (b * c)) * c) * i))
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return 2.0 * (((x * y) + (z * t)) - (((a + (b * c)) * c) * i));
}
def code(x, y, z, t, a, b, c, i): return 2.0 * (((x * y) + (z * t)) - (((a + (b * c)) * c) * i))
function code(x, y, z, t, a, b, c, i) return Float64(2.0 * Float64(Float64(Float64(x * y) + Float64(z * t)) - Float64(Float64(Float64(a + Float64(b * c)) * c) * i))) end
function tmp = code(x, y, z, t, a, b, c, i) tmp = 2.0 * (((x * y) + (z * t)) - (((a + (b * c)) * c) * i)); end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(2.0 * N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] - N[(N[(N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision] * c), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
2 \cdot \left(\left(x \cdot y + z \cdot t\right) - \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i\right)
\end{array}
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ a (* b c))) (t_2 (+ (* x y) (* z t))))
(if (<= (- t_2 (* (* c t_1) i)) INFINITY)
(* 2.0 (- t_2 (* t_1 (* c i))))
(* x (+ (* -2.0 (/ (* c (* t_1 i)) 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 = a + (b * c);
double t_2 = (x * y) + (z * t);
double tmp;
if ((t_2 - ((c * t_1) * i)) <= ((double) INFINITY)) {
tmp = 2.0 * (t_2 - (t_1 * (c * i)));
} else {
tmp = x * ((-2.0 * ((c * (t_1 * i)) / x)) + (y * 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 = (x * y) + (z * t);
double tmp;
if ((t_2 - ((c * t_1) * i)) <= Double.POSITIVE_INFINITY) {
tmp = 2.0 * (t_2 - (t_1 * (c * i)));
} else {
tmp = x * ((-2.0 * ((c * (t_1 * i)) / x)) + (y * 2.0));
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = a + (b * c) t_2 = (x * y) + (z * t) tmp = 0 if (t_2 - ((c * t_1) * i)) <= math.inf: tmp = 2.0 * (t_2 - (t_1 * (c * i))) else: tmp = x * ((-2.0 * ((c * (t_1 * i)) / x)) + (y * 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(x * y) + Float64(z * t)) 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(x * Float64(Float64(-2.0 * Float64(Float64(c * Float64(t_1 * i)) / x)) + Float64(y * 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 = (x * y) + (z * t); tmp = 0.0; if ((t_2 - ((c * t_1) * i)) <= Inf) tmp = 2.0 * (t_2 - (t_1 * (c * i))); else tmp = x * ((-2.0 * ((c * (t_1 * i)) / x)) + (y * 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[(x * y), $MachinePrecision] + N[(z * t), $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[(x * N[(N[(-2.0 * N[(N[(c * N[(t$95$1 * i), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision] + N[(y * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a + b \cdot c\\
t_2 := x \cdot y + z \cdot t\\
\mathbf{if}\;t\_2 - \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}:\\
\;\;\;\;x \cdot \left(-2 \cdot \frac{c \cdot \left(t\_1 \cdot i\right)}{x} + y \cdot 2\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 94.1%
fma-define94.1%
associate-*l*98.7%
Simplified98.7%
fma-define98.7%
+-commutative98.7%
Applied egg-rr98.7%
if +inf.0 < (-.f64 (+.f64 (*.f64 x y) (*.f64 z t)) (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i)) Initial program 0.0%
Taylor expanded in x around inf 41.7%
Taylor expanded in x around inf 91.7%
Final simplification98.4%
(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+248)))
(* -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+248)) {
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+248)) {
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+248): 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+248)) 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+248))) 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+248]], $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^{+248}\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.00000000000000018e248 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) Initial program 74.8%
fma-define74.8%
*-commutative74.8%
associate-*l*87.5%
+-commutative87.5%
fma-define87.5%
Simplified87.5%
Taylor expanded in i around inf 90.8%
if -inf.0 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 4.00000000000000018e248Initial program 98.7%
Final simplification95.7%
(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+299) (not (<= t_2 4e+248)))
(* -2.0 (* c (* t_1 i)))
(* 2.0 (- (+ (* x y) (* z t)) (* (* c i) (* b 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+299) || !(t_2 <= 4e+248)) {
tmp = -2.0 * (c * (t_1 * i));
} else {
tmp = 2.0 * (((x * y) + (z * t)) - ((c * i) * (b * c)));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = a + (b * c)
t_2 = (c * t_1) * i
if ((t_2 <= (-1d+299)) .or. (.not. (t_2 <= 4d+248))) then
tmp = (-2.0d0) * (c * (t_1 * i))
else
tmp = 2.0d0 * (((x * y) + (z * t)) - ((c * i) * (b * c)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = a + (b * c);
double t_2 = (c * t_1) * i;
double tmp;
if ((t_2 <= -1e+299) || !(t_2 <= 4e+248)) {
tmp = -2.0 * (c * (t_1 * i));
} else {
tmp = 2.0 * (((x * y) + (z * t)) - ((c * i) * (b * 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+299) or not (t_2 <= 4e+248): tmp = -2.0 * (c * (t_1 * i)) else: tmp = 2.0 * (((x * y) + (z * t)) - ((c * i) * (b * 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+299) || !(t_2 <= 4e+248)) tmp = Float64(-2.0 * Float64(c * Float64(t_1 * i))); else tmp = Float64(2.0 * Float64(Float64(Float64(x * y) + Float64(z * t)) - Float64(Float64(c * i) * Float64(b * 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+299) || ~((t_2 <= 4e+248))) tmp = -2.0 * (c * (t_1 * i)); else tmp = 2.0 * (((x * y) + (z * t)) - ((c * i) * (b * 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+299], N[Not[LessEqual[t$95$2, 4e+248]], $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[(N[(c * i), $MachinePrecision] * N[(b * 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^{+299} \lor \neg \left(t\_2 \leq 4 \cdot 10^{+248}\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) - \left(c \cdot i\right) \cdot \left(b \cdot c\right)\right)\\
\end{array}
\end{array}
if (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < -1.0000000000000001e299 or 4.00000000000000018e248 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) Initial program 75.3%
fma-define75.3%
*-commutative75.3%
associate-*l*87.8%
+-commutative87.8%
fma-define87.8%
Simplified87.8%
Taylor expanded in i around inf 91.0%
if -1.0000000000000001e299 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 4.00000000000000018e248Initial program 98.6%
fma-define98.6%
associate-*l*99.3%
Simplified99.3%
fma-define99.3%
+-commutative99.3%
Applied egg-rr99.3%
Taylor expanded in a around 0 88.9%
*-commutative88.9%
Simplified88.9%
Final simplification89.7%
(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+299) (not (<= t_2 4e+248)))
(* -2.0 (* c (* t_1 i)))
(* 2.0 (- (+ (* x y) (* z t)) (* i (* c (* b 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+299) || !(t_2 <= 4e+248)) {
tmp = -2.0 * (c * (t_1 * i));
} else {
tmp = 2.0 * (((x * y) + (z * t)) - (i * (c * (b * c))));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = a + (b * c)
t_2 = (c * t_1) * i
if ((t_2 <= (-1d+299)) .or. (.not. (t_2 <= 4d+248))) then
tmp = (-2.0d0) * (c * (t_1 * i))
else
tmp = 2.0d0 * (((x * y) + (z * t)) - (i * (c * (b * c))))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = a + (b * c);
double t_2 = (c * t_1) * i;
double tmp;
if ((t_2 <= -1e+299) || !(t_2 <= 4e+248)) {
tmp = -2.0 * (c * (t_1 * i));
} else {
tmp = 2.0 * (((x * y) + (z * t)) - (i * (c * (b * 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+299) or not (t_2 <= 4e+248): tmp = -2.0 * (c * (t_1 * i)) else: tmp = 2.0 * (((x * y) + (z * t)) - (i * (c * (b * 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+299) || !(t_2 <= 4e+248)) 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(c * Float64(b * 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+299) || ~((t_2 <= 4e+248))) tmp = -2.0 * (c * (t_1 * i)); else tmp = 2.0 * (((x * y) + (z * t)) - (i * (c * (b * 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+299], N[Not[LessEqual[t$95$2, 4e+248]], $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[(c * N[(b * c), $MachinePrecision]), $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^{+299} \lor \neg \left(t\_2 \leq 4 \cdot 10^{+248}\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(c \cdot \left(b \cdot c\right)\right)\right)\\
\end{array}
\end{array}
if (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < -1.0000000000000001e299 or 4.00000000000000018e248 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) Initial program 75.3%
fma-define75.3%
*-commutative75.3%
associate-*l*87.8%
+-commutative87.8%
fma-define87.8%
Simplified87.8%
Taylor expanded in i around inf 91.0%
if -1.0000000000000001e299 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 4.00000000000000018e248Initial program 98.6%
Taylor expanded in a around 0 88.3%
*-commutative88.9%
Simplified88.3%
Final simplification89.3%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ a (* b c))) (t_2 (* (* c t_1) i)))
(if (<= t_2 -2e+50)
(* 2.0 (- (* z t) (* c (* t_1 i))))
(if (<= t_2 2000000000000.0)
(* (+ (* x y) (* z t)) 2.0)
(* 2.0 (- (* x y) 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 tmp;
if (t_2 <= -2e+50) {
tmp = 2.0 * ((z * t) - (c * (t_1 * i)));
} else if (t_2 <= 2000000000000.0) {
tmp = ((x * y) + (z * t)) * 2.0;
} else {
tmp = 2.0 * ((x * y) - 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 = a + (b * c)
t_2 = (c * t_1) * i
if (t_2 <= (-2d+50)) then
tmp = 2.0d0 * ((z * t) - (c * (t_1 * i)))
else if (t_2 <= 2000000000000.0d0) then
tmp = ((x * y) + (z * t)) * 2.0d0
else
tmp = 2.0d0 * ((x * y) - 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 tmp;
if (t_2 <= -2e+50) {
tmp = 2.0 * ((z * t) - (c * (t_1 * i)));
} else if (t_2 <= 2000000000000.0) {
tmp = ((x * y) + (z * t)) * 2.0;
} else {
tmp = 2.0 * ((x * y) - 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 tmp = 0 if t_2 <= -2e+50: tmp = 2.0 * ((z * t) - (c * (t_1 * i))) elif t_2 <= 2000000000000.0: tmp = ((x * y) + (z * t)) * 2.0 else: tmp = 2.0 * ((x * y) - t_2) 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 <= -2e+50) tmp = Float64(2.0 * Float64(Float64(z * t) - Float64(c * Float64(t_1 * i)))); elseif (t_2 <= 2000000000000.0) tmp = Float64(Float64(Float64(x * y) + Float64(z * t)) * 2.0); else tmp = Float64(2.0 * Float64(Float64(x * y) - 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; tmp = 0.0; if (t_2 <= -2e+50) tmp = 2.0 * ((z * t) - (c * (t_1 * i))); elseif (t_2 <= 2000000000000.0) tmp = ((x * y) + (z * t)) * 2.0; else tmp = 2.0 * ((x * y) - 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[(N[(c * t$95$1), $MachinePrecision] * i), $MachinePrecision]}, If[LessEqual[t$95$2, -2e+50], N[(2.0 * N[(N[(z * t), $MachinePrecision] - N[(c * N[(t$95$1 * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, 2000000000000.0], N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision], N[(2.0 * N[(N[(x * y), $MachinePrecision] - t$95$2), $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 -2 \cdot 10^{+50}:\\
\;\;\;\;2 \cdot \left(z \cdot t - c \cdot \left(t\_1 \cdot i\right)\right)\\
\mathbf{elif}\;t\_2 \leq 2000000000000:\\
\;\;\;\;\left(x \cdot y + z \cdot t\right) \cdot 2\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(x \cdot y - t\_2\right)\\
\end{array}
\end{array}
if (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < -2.0000000000000002e50Initial program 83.4%
fma-define83.4%
*-commutative83.4%
associate-*l*89.2%
+-commutative89.2%
fma-define89.1%
Simplified89.1%
Taylor expanded in x around 0 84.8%
if -2.0000000000000002e50 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 2e12Initial program 98.3%
fma-define98.3%
*-commutative98.3%
associate-*l*99.1%
+-commutative99.1%
fma-define99.1%
Simplified99.1%
Taylor expanded in c around 0 90.9%
if 2e12 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) Initial program 81.9%
Taylor expanded in x around inf 80.7%
Final simplification86.3%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ a (* b c))) (t_2 (+ (* x y) (* z t))))
(if (<= (- t_2 (* (* c t_1) i)) INFINITY)
(* 2.0 (- t_2 (* t_1 (* c i))))
(* t (+ (* -2.0 (/ (* c (* t_1 i)) t)) (* z 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 = (x * y) + (z * t);
double tmp;
if ((t_2 - ((c * t_1) * i)) <= ((double) INFINITY)) {
tmp = 2.0 * (t_2 - (t_1 * (c * i)));
} else {
tmp = t * ((-2.0 * ((c * (t_1 * i)) / t)) + (z * 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 = (x * y) + (z * t);
double tmp;
if ((t_2 - ((c * t_1) * i)) <= Double.POSITIVE_INFINITY) {
tmp = 2.0 * (t_2 - (t_1 * (c * i)));
} else {
tmp = t * ((-2.0 * ((c * (t_1 * i)) / t)) + (z * 2.0));
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = a + (b * c) t_2 = (x * y) + (z * t) tmp = 0 if (t_2 - ((c * t_1) * i)) <= math.inf: tmp = 2.0 * (t_2 - (t_1 * (c * i))) else: tmp = t * ((-2.0 * ((c * (t_1 * i)) / t)) + (z * 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(x * y) + Float64(z * t)) 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(t * Float64(Float64(-2.0 * Float64(Float64(c * Float64(t_1 * i)) / t)) + Float64(z * 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 = (x * y) + (z * t); tmp = 0.0; if ((t_2 - ((c * t_1) * i)) <= Inf) tmp = 2.0 * (t_2 - (t_1 * (c * i))); else tmp = t * ((-2.0 * ((c * (t_1 * i)) / t)) + (z * 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[(x * y), $MachinePrecision] + N[(z * t), $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[(t * N[(N[(-2.0 * N[(N[(c * N[(t$95$1 * i), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision] + N[(z * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a + b \cdot c\\
t_2 := x \cdot y + z \cdot t\\
\mathbf{if}\;t\_2 - \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}:\\
\;\;\;\;t \cdot \left(-2 \cdot \frac{c \cdot \left(t\_1 \cdot i\right)}{t} + z \cdot 2\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 94.1%
fma-define94.1%
associate-*l*98.7%
Simplified98.7%
fma-define98.7%
+-commutative98.7%
Applied egg-rr98.7%
if +inf.0 < (-.f64 (+.f64 (*.f64 x y) (*.f64 z t)) (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i)) Initial program 0.0%
fma-define0.0%
*-commutative0.0%
associate-*l*16.7%
+-commutative16.7%
fma-define16.7%
Simplified16.7%
Taylor expanded in t around inf 58.3%
Taylor expanded in x around 0 75.0%
Final simplification97.6%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ a (* b c))) (t_2 (+ (* x y) (* z t))))
(if (<= (- t_2 (* (* 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 = (x * y) + (z * t);
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 = (x * y) + (z * t);
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 = (x * y) + (z * t) 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(x * y) + Float64(z * t)) 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 = (x * y) + (z * t); 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[(x * y), $MachinePrecision] + N[(z * t), $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 := x \cdot y + z \cdot t\\
\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 94.1%
fma-define94.1%
associate-*l*98.7%
Simplified98.7%
fma-define98.7%
+-commutative98.7%
Applied egg-rr98.7%
if +inf.0 < (-.f64 (+.f64 (*.f64 x y) (*.f64 z t)) (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i)) Initial program 0.0%
fma-define0.0%
*-commutative0.0%
associate-*l*16.7%
+-commutative16.7%
fma-define16.7%
Simplified16.7%
Taylor expanded in i around inf 67.2%
Final simplification97.2%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= c -235000.0) (not (<= c 1.55e+22))) (* 2.0 (- (* z t) (* 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 <= -235000.0) || !(c <= 1.55e+22)) {
tmp = 2.0 * ((z * t) - (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 <= (-235000.0d0)) .or. (.not. (c <= 1.55d+22))) then
tmp = 2.0d0 * ((z * t) - (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 <= -235000.0) || !(c <= 1.55e+22)) {
tmp = 2.0 * ((z * t) - (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 <= -235000.0) or not (c <= 1.55e+22): tmp = 2.0 * ((z * t) - (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 <= -235000.0) || !(c <= 1.55e+22)) tmp = Float64(2.0 * Float64(Float64(z * t) - 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 <= -235000.0) || ~((c <= 1.55e+22))) tmp = 2.0 * ((z * t) - (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, -235000.0], N[Not[LessEqual[c, 1.55e+22]], $MachinePrecision]], N[(2.0 * N[(N[(z * t), $MachinePrecision] - N[(c * N[(N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;c \leq -235000 \lor \neg \left(c \leq 1.55 \cdot 10^{+22}\right):\\
\;\;\;\;2 \cdot \left(z \cdot t - 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 < -235000 or 1.5500000000000001e22 < c Initial program 80.1%
fma-define80.1%
*-commutative80.1%
associate-*l*90.1%
+-commutative90.1%
fma-define90.1%
Simplified90.1%
Taylor expanded in x around 0 86.9%
if -235000 < c < 1.5500000000000001e22Initial program 98.5%
fma-define98.5%
*-commutative98.5%
associate-*l*93.5%
+-commutative93.5%
fma-define93.5%
Simplified93.5%
Taylor expanded in c around 0 84.7%
Final simplification85.7%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* -2.0 (* a (* c i)))))
(if (<= c -4.7e+18)
t_1
(if (<= c 4e-226)
(* t (* z 2.0))
(if (<= c 1.6e+22) (* x (* y 2.0)) t_1)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = -2.0 * (a * (c * i));
double tmp;
if (c <= -4.7e+18) {
tmp = t_1;
} else if (c <= 4e-226) {
tmp = t * (z * 2.0);
} else if (c <= 1.6e+22) {
tmp = x * (y * 2.0);
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: t_1
real(8) :: tmp
t_1 = (-2.0d0) * (a * (c * i))
if (c <= (-4.7d+18)) then
tmp = t_1
else if (c <= 4d-226) then
tmp = t * (z * 2.0d0)
else if (c <= 1.6d+22) then
tmp = x * (y * 2.0d0)
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = -2.0 * (a * (c * i));
double tmp;
if (c <= -4.7e+18) {
tmp = t_1;
} else if (c <= 4e-226) {
tmp = t * (z * 2.0);
} else if (c <= 1.6e+22) {
tmp = x * (y * 2.0);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = -2.0 * (a * (c * i)) tmp = 0 if c <= -4.7e+18: tmp = t_1 elif c <= 4e-226: tmp = t * (z * 2.0) elif c <= 1.6e+22: tmp = x * (y * 2.0) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(-2.0 * Float64(a * Float64(c * i))) tmp = 0.0 if (c <= -4.7e+18) tmp = t_1; elseif (c <= 4e-226) tmp = Float64(t * Float64(z * 2.0)); elseif (c <= 1.6e+22) tmp = Float64(x * Float64(y * 2.0)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = -2.0 * (a * (c * i)); tmp = 0.0; if (c <= -4.7e+18) tmp = t_1; elseif (c <= 4e-226) tmp = t * (z * 2.0); elseif (c <= 1.6e+22) tmp = x * (y * 2.0); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(-2.0 * N[(a * N[(c * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[c, -4.7e+18], t$95$1, If[LessEqual[c, 4e-226], N[(t * N[(z * 2.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[c, 1.6e+22], N[(x * N[(y * 2.0), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := -2 \cdot \left(a \cdot \left(c \cdot i\right)\right)\\
\mathbf{if}\;c \leq -4.7 \cdot 10^{+18}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;c \leq 4 \cdot 10^{-226}:\\
\;\;\;\;t \cdot \left(z \cdot 2\right)\\
\mathbf{elif}\;c \leq 1.6 \cdot 10^{+22}:\\
\;\;\;\;x \cdot \left(y \cdot 2\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if c < -4.7e18 or 1.6e22 < c Initial program 79.6%
fma-define79.6%
*-commutative79.6%
associate-*l*89.8%
+-commutative89.8%
fma-define89.8%
Simplified89.8%
Taylor expanded in a around inf 42.5%
if -4.7e18 < c < 3.99999999999999969e-226Initial program 97.8%
fma-define97.8%
*-commutative97.8%
associate-*l*92.6%
+-commutative92.6%
fma-define92.6%
Simplified92.6%
Taylor expanded in z around inf 48.6%
associate-*r*48.6%
*-commutative48.6%
associate-*l*48.6%
*-commutative48.6%
Simplified48.6%
if 3.99999999999999969e-226 < c < 1.6e22Initial program 99.9%
fma-define99.9%
*-commutative99.9%
associate-*l*95.8%
+-commutative95.8%
fma-define95.8%
Simplified95.8%
Taylor expanded in x around inf 55.3%
*-commutative55.3%
associate-*l*55.3%
Simplified55.3%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= c -4.7e+18) (not (<= c 1.7e+22))) (* -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 <= -4.7e+18) || !(c <= 1.7e+22)) {
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 <= (-4.7d+18)) .or. (.not. (c <= 1.7d+22))) 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 <= -4.7e+18) || !(c <= 1.7e+22)) {
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 <= -4.7e+18) or not (c <= 1.7e+22): 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 <= -4.7e+18) || !(c <= 1.7e+22)) 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 <= -4.7e+18) || ~((c <= 1.7e+22))) 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, -4.7e+18], N[Not[LessEqual[c, 1.7e+22]], $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 -4.7 \cdot 10^{+18} \lor \neg \left(c \leq 1.7 \cdot 10^{+22}\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 < -4.7e18 or 1.7e22 < c Initial program 79.6%
fma-define79.6%
*-commutative79.6%
associate-*l*89.8%
+-commutative89.8%
fma-define89.8%
Simplified89.8%
Taylor expanded in i around inf 79.4%
if -4.7e18 < c < 1.7e22Initial program 98.5%
fma-define98.5%
*-commutative98.5%
associate-*l*93.7%
+-commutative93.7%
fma-define93.7%
Simplified93.7%
Taylor expanded in c around 0 84.3%
Final simplification82.0%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= c -2.05e+97) (not (<= c 4.5e+55))) (* -2.0 (* a (* c i))) (* (+ (* x y) (* z t)) 2.0)))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((c <= -2.05e+97) || !(c <= 4.5e+55)) {
tmp = -2.0 * (a * (c * i));
} else {
tmp = ((x * y) + (z * t)) * 2.0;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: tmp
if ((c <= (-2.05d+97)) .or. (.not. (c <= 4.5d+55))) then
tmp = (-2.0d0) * (a * (c * i))
else
tmp = ((x * y) + (z * t)) * 2.0d0
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((c <= -2.05e+97) || !(c <= 4.5e+55)) {
tmp = -2.0 * (a * (c * i));
} else {
tmp = ((x * y) + (z * t)) * 2.0;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if (c <= -2.05e+97) or not (c <= 4.5e+55): tmp = -2.0 * (a * (c * i)) else: tmp = ((x * y) + (z * t)) * 2.0 return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if ((c <= -2.05e+97) || !(c <= 4.5e+55)) tmp = Float64(-2.0 * Float64(a * Float64(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 <= -2.05e+97) || ~((c <= 4.5e+55))) tmp = -2.0 * (a * (c * i)); else tmp = ((x * y) + (z * t)) * 2.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[c, -2.05e+97], N[Not[LessEqual[c, 4.5e+55]], $MachinePrecision]], N[(-2.0 * N[(a * N[(c * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;c \leq -2.05 \cdot 10^{+97} \lor \neg \left(c \leq 4.5 \cdot 10^{+55}\right):\\
\;\;\;\;-2 \cdot \left(a \cdot \left(c \cdot i\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(x \cdot y + z \cdot t\right) \cdot 2\\
\end{array}
\end{array}
if c < -2.04999999999999994e97 or 4.49999999999999998e55 < c Initial program 77.9%
fma-define77.9%
*-commutative77.9%
associate-*l*89.6%
+-commutative89.6%
fma-define89.5%
Simplified89.5%
Taylor expanded in a around inf 45.1%
if -2.04999999999999994e97 < c < 4.49999999999999998e55Initial program 96.8%
fma-define96.8%
*-commutative96.8%
associate-*l*93.3%
+-commutative93.3%
fma-define93.3%
Simplified93.3%
Taylor expanded in c around 0 77.2%
Final simplification65.2%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= t -1.3e-174) (not (<= t 1.25e+63))) (* t (* z 2.0)) (* 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 ((t <= -1.3e-174) || !(t <= 1.25e+63)) {
tmp = t * (z * 2.0);
} else {
tmp = 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 ((t <= (-1.3d-174)) .or. (.not. (t <= 1.25d+63))) then
tmp = t * (z * 2.0d0)
else
tmp = 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 ((t <= -1.3e-174) || !(t <= 1.25e+63)) {
tmp = t * (z * 2.0);
} else {
tmp = x * (y * 2.0);
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if (t <= -1.3e-174) or not (t <= 1.25e+63): tmp = t * (z * 2.0) else: tmp = x * (y * 2.0) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if ((t <= -1.3e-174) || !(t <= 1.25e+63)) tmp = Float64(t * Float64(z * 2.0)); else tmp = Float64(x * Float64(y * 2.0)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if ((t <= -1.3e-174) || ~((t <= 1.25e+63))) tmp = t * (z * 2.0); else tmp = x * (y * 2.0); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[t, -1.3e-174], N[Not[LessEqual[t, 1.25e+63]], $MachinePrecision]], N[(t * N[(z * 2.0), $MachinePrecision]), $MachinePrecision], N[(x * N[(y * 2.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.3 \cdot 10^{-174} \lor \neg \left(t \leq 1.25 \cdot 10^{+63}\right):\\
\;\;\;\;t \cdot \left(z \cdot 2\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(y \cdot 2\right)\\
\end{array}
\end{array}
if t < -1.3000000000000001e-174 or 1.25000000000000003e63 < t Initial program 87.3%
fma-define87.3%
*-commutative87.3%
associate-*l*90.2%
+-commutative90.2%
fma-define90.1%
Simplified90.1%
Taylor expanded in z around inf 38.0%
associate-*r*38.0%
*-commutative38.0%
associate-*l*38.0%
*-commutative38.0%
Simplified38.0%
if -1.3000000000000001e-174 < t < 1.25000000000000003e63Initial program 93.8%
fma-define93.8%
*-commutative93.8%
associate-*l*94.8%
+-commutative94.8%
fma-define94.8%
Simplified94.8%
Taylor expanded in x around inf 36.2%
*-commutative36.2%
associate-*l*36.2%
Simplified36.2%
Final simplification37.4%
(FPCore (x y z t a b c i) :precision binary64 (* t (* z 2.0)))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return t * (z * 2.0);
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
code = t * (z * 2.0d0)
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return t * (z * 2.0);
}
def code(x, y, z, t, a, b, c, i): return t * (z * 2.0)
function code(x, y, z, t, a, b, c, i) return Float64(t * Float64(z * 2.0)) end
function tmp = code(x, y, z, t, a, b, c, i) tmp = t * (z * 2.0); end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(t * N[(z * 2.0), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
t \cdot \left(z \cdot 2\right)
\end{array}
Initial program 89.7%
fma-define89.7%
*-commutative89.7%
associate-*l*91.9%
+-commutative91.9%
fma-define91.9%
Simplified91.9%
Taylor expanded in z around inf 31.2%
associate-*r*31.2%
*-commutative31.2%
associate-*l*31.2%
*-commutative31.2%
Simplified31.2%
(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 2024181
(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
(! :herbie-platform default (* 2 (- (+ (* x y) (* z t)) (* (+ a (* b c)) (* c i)))))
(* 2.0 (- (+ (* x y) (* z t)) (* (* (+ a (* b c)) c) i))))