
(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 10 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 (* (* c t_1) i)) (t_3 (* c (* t_1 i))))
(if (<= t_2 (- INFINITY))
(* 2.0 (- (* z t) t_3))
(if (<= t_2 5e+287) (* 2.0 (- (+ (* x y) (* z t)) t_2)) (* -2.0 t_3)))))
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_2 <= -((double) INFINITY)) {
tmp = 2.0 * ((z * t) - t_3);
} else if (t_2 <= 5e+287) {
tmp = 2.0 * (((x * y) + (z * t)) - t_2);
} else {
tmp = -2.0 * t_3;
}
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 t_3 = c * (t_1 * i);
double tmp;
if (t_2 <= -Double.POSITIVE_INFINITY) {
tmp = 2.0 * ((z * t) - t_3);
} else if (t_2 <= 5e+287) {
tmp = 2.0 * (((x * y) + (z * t)) - t_2);
} else {
tmp = -2.0 * t_3;
}
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_2 <= -math.inf: tmp = 2.0 * ((z * t) - t_3) elif t_2 <= 5e+287: tmp = 2.0 * (((x * y) + (z * t)) - t_2) else: tmp = -2.0 * t_3 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) t_3 = Float64(c * Float64(t_1 * i)) tmp = 0.0 if (t_2 <= Float64(-Inf)) tmp = Float64(2.0 * Float64(Float64(z * t) - t_3)); elseif (t_2 <= 5e+287) tmp = Float64(2.0 * Float64(Float64(Float64(x * y) + Float64(z * t)) - t_2)); else tmp = Float64(-2.0 * t_3); 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_2 <= -Inf) tmp = 2.0 * ((z * t) - t_3); elseif (t_2 <= 5e+287) tmp = 2.0 * (((x * y) + (z * t)) - t_2); else tmp = -2.0 * t_3; 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]}, Block[{t$95$3 = N[(c * N[(t$95$1 * i), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, (-Infinity)], N[(2.0 * N[(N[(z * t), $MachinePrecision] - t$95$3), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, 5e+287], N[(2.0 * N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] - t$95$2), $MachinePrecision]), $MachinePrecision], N[(-2.0 * t$95$3), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a + b \cdot c\\
t_2 := \left(c \cdot t\_1\right) \cdot i\\
t_3 := c \cdot \left(t\_1 \cdot i\right)\\
\mathbf{if}\;t\_2 \leq -\infty:\\
\;\;\;\;2 \cdot \left(z \cdot t - t\_3\right)\\
\mathbf{elif}\;t\_2 \leq 5 \cdot 10^{+287}:\\
\;\;\;\;2 \cdot \left(\left(x \cdot y + z \cdot t\right) - t\_2\right)\\
\mathbf{else}:\\
\;\;\;\;-2 \cdot t\_3\\
\end{array}
\end{array}
if (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < -inf.0Initial program 84.2%
fma-define84.2%
*-commutative84.2%
associate-*l*97.4%
+-commutative97.4%
fma-define97.4%
Simplified97.4%
Taylor expanded in x around 0 97.4%
if -inf.0 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 5e287Initial program 99.9%
if 5e287 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) Initial program 73.2%
fma-define73.2%
*-commutative73.2%
associate-*l*83.1%
+-commutative83.1%
fma-define83.1%
Simplified83.1%
Taylor expanded in i around inf 91.7%
Final simplification98.0%
(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 -1e+41)
(* 2.0 (- (* z t) t_2))
(if (<= t_3 5e+64)
(* 2.0 (+ (* x y) (* z t)))
(if (<= t_3 5e+287) (* 2.0 (- (* x y) t_3)) (* -2.0 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 <= -1e+41) {
tmp = 2.0 * ((z * t) - t_2);
} else if (t_3 <= 5e+64) {
tmp = 2.0 * ((x * y) + (z * t));
} else if (t_3 <= 5e+287) {
tmp = 2.0 * ((x * y) - t_3);
} else {
tmp = -2.0 * 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 <= (-1d+41)) then
tmp = 2.0d0 * ((z * t) - t_2)
else if (t_3 <= 5d+64) then
tmp = 2.0d0 * ((x * y) + (z * t))
else if (t_3 <= 5d+287) then
tmp = 2.0d0 * ((x * y) - t_3)
else
tmp = (-2.0d0) * 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 <= -1e+41) {
tmp = 2.0 * ((z * t) - t_2);
} else if (t_3 <= 5e+64) {
tmp = 2.0 * ((x * y) + (z * t));
} else if (t_3 <= 5e+287) {
tmp = 2.0 * ((x * y) - t_3);
} else {
tmp = -2.0 * 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 <= -1e+41: tmp = 2.0 * ((z * t) - t_2) elif t_3 <= 5e+64: tmp = 2.0 * ((x * y) + (z * t)) elif t_3 <= 5e+287: tmp = 2.0 * ((x * y) - t_3) else: tmp = -2.0 * 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 <= -1e+41) tmp = Float64(2.0 * Float64(Float64(z * t) - t_2)); elseif (t_3 <= 5e+64) tmp = Float64(2.0 * Float64(Float64(x * y) + Float64(z * t))); elseif (t_3 <= 5e+287) tmp = Float64(2.0 * Float64(Float64(x * y) - t_3)); else tmp = Float64(-2.0 * 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 <= -1e+41) tmp = 2.0 * ((z * t) - t_2); elseif (t_3 <= 5e+64) tmp = 2.0 * ((x * y) + (z * t)); elseif (t_3 <= 5e+287) tmp = 2.0 * ((x * y) - t_3); else tmp = -2.0 * 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, -1e+41], N[(2.0 * N[(N[(z * t), $MachinePrecision] - t$95$2), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$3, 5e+64], N[(2.0 * N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$3, 5e+287], N[(2.0 * N[(N[(x * y), $MachinePrecision] - t$95$3), $MachinePrecision]), $MachinePrecision], N[(-2.0 * t$95$2), $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 -1 \cdot 10^{+41}:\\
\;\;\;\;2 \cdot \left(z \cdot t - t\_2\right)\\
\mathbf{elif}\;t\_3 \leq 5 \cdot 10^{+64}:\\
\;\;\;\;2 \cdot \left(x \cdot y + z \cdot t\right)\\
\mathbf{elif}\;t\_3 \leq 5 \cdot 10^{+287}:\\
\;\;\;\;2 \cdot \left(x \cdot y - t\_3\right)\\
\mathbf{else}:\\
\;\;\;\;-2 \cdot t\_2\\
\end{array}
\end{array}
if (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < -1.00000000000000001e41Initial program 89.6%
fma-define89.6%
*-commutative89.6%
associate-*l*94.8%
+-commutative94.8%
fma-define94.8%
Simplified94.8%
Taylor expanded in x around 0 89.8%
if -1.00000000000000001e41 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 5e64Initial program 99.9%
fma-define99.9%
*-commutative99.9%
associate-*l*99.2%
+-commutative99.2%
fma-define99.2%
Simplified99.2%
Taylor expanded in c around 0 93.4%
if 5e64 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 5e287Initial program 99.9%
Taylor expanded in x around inf 83.5%
if 5e287 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) Initial program 73.2%
fma-define73.2%
*-commutative73.2%
associate-*l*83.1%
+-commutative83.1%
fma-define83.1%
Simplified83.1%
Taylor expanded in i around inf 91.7%
Final simplification91.1%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ a (* b c))))
(if (<= (* (* c t_1) i) 5e+287)
(* 2.0 (- (+ (* x y) (* z t)) (* t_1 (* c i))))
(* -2.0 (* c (* t_1 i))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = a + (b * c);
double tmp;
if (((c * t_1) * i) <= 5e+287) {
tmp = 2.0 * (((x * y) + (z * t)) - (t_1 * (c * i)));
} else {
tmp = -2.0 * (c * (t_1 * i));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: t_1
real(8) :: tmp
t_1 = a + (b * c)
if (((c * t_1) * i) <= 5d+287) then
tmp = 2.0d0 * (((x * y) + (z * t)) - (t_1 * (c * i)))
else
tmp = (-2.0d0) * (c * (t_1 * i))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = a + (b * c);
double tmp;
if (((c * t_1) * i) <= 5e+287) {
tmp = 2.0 * (((x * y) + (z * t)) - (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) tmp = 0 if ((c * t_1) * i) <= 5e+287: tmp = 2.0 * (((x * y) + (z * t)) - (t_1 * (c * i))) else: tmp = -2.0 * (c * (t_1 * i)) return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(a + Float64(b * c)) tmp = 0.0 if (Float64(Float64(c * t_1) * i) <= 5e+287) tmp = Float64(2.0 * Float64(Float64(Float64(x * y) + Float64(z * t)) - Float64(t_1 * Float64(c * i)))); else tmp = Float64(-2.0 * Float64(c * Float64(t_1 * i))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = a + (b * c); tmp = 0.0; if (((c * t_1) * i) <= 5e+287) tmp = 2.0 * (((x * y) + (z * t)) - (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]}, If[LessEqual[N[(N[(c * t$95$1), $MachinePrecision] * i), $MachinePrecision], 5e+287], N[(2.0 * N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] - N[(t$95$1 * N[(c * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(-2.0 * N[(c * N[(t$95$1 * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a + b \cdot c\\
\mathbf{if}\;\left(c \cdot t\_1\right) \cdot i \leq 5 \cdot 10^{+287}:\\
\;\;\;\;2 \cdot \left(\left(x \cdot y + z \cdot t\right) - t\_1 \cdot \left(c \cdot i\right)\right)\\
\mathbf{else}:\\
\;\;\;\;-2 \cdot \left(c \cdot \left(t\_1 \cdot i\right)\right)\\
\end{array}
\end{array}
if (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 5e287Initial program 97.1%
fma-define97.1%
associate-*l*98.5%
Simplified98.5%
fma-define98.5%
+-commutative98.5%
Applied egg-rr98.5%
if 5e287 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) Initial program 73.2%
fma-define73.2%
*-commutative73.2%
associate-*l*83.1%
+-commutative83.1%
fma-define83.1%
Simplified83.1%
Taylor expanded in i around inf 91.7%
Final simplification97.3%
(FPCore (x y z t a b c i)
:precision binary64
(if (<= (* x y) -4e+77)
(* 2.0 (+ (* x y) (* z t)))
(if (<= (* x y) 2.8e+176)
(* 2.0 (- (* z t) (* c (* (+ a (* b c)) i))))
(* 2.0 (- (* x y) (* a (* c i)))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((x * y) <= -4e+77) {
tmp = 2.0 * ((x * y) + (z * t));
} else if ((x * y) <= 2.8e+176) {
tmp = 2.0 * ((z * t) - (c * ((a + (b * c)) * i)));
} else {
tmp = 2.0 * ((x * y) - (a * (c * i)));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: tmp
if ((x * y) <= (-4d+77)) then
tmp = 2.0d0 * ((x * y) + (z * t))
else if ((x * y) <= 2.8d+176) then
tmp = 2.0d0 * ((z * t) - (c * ((a + (b * c)) * i)))
else
tmp = 2.0d0 * ((x * y) - (a * (c * i)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((x * y) <= -4e+77) {
tmp = 2.0 * ((x * y) + (z * t));
} else if ((x * y) <= 2.8e+176) {
tmp = 2.0 * ((z * t) - (c * ((a + (b * c)) * i)));
} else {
tmp = 2.0 * ((x * y) - (a * (c * i)));
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if (x * y) <= -4e+77: tmp = 2.0 * ((x * y) + (z * t)) elif (x * y) <= 2.8e+176: tmp = 2.0 * ((z * t) - (c * ((a + (b * c)) * i))) else: tmp = 2.0 * ((x * y) - (a * (c * i))) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (Float64(x * y) <= -4e+77) tmp = Float64(2.0 * Float64(Float64(x * y) + Float64(z * t))); elseif (Float64(x * y) <= 2.8e+176) tmp = Float64(2.0 * Float64(Float64(z * t) - Float64(c * Float64(Float64(a + Float64(b * c)) * i)))); else tmp = Float64(2.0 * Float64(Float64(x * y) - Float64(a * Float64(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+77) tmp = 2.0 * ((x * y) + (z * t)); elseif ((x * y) <= 2.8e+176) tmp = 2.0 * ((z * t) - (c * ((a + (b * c)) * i))); else tmp = 2.0 * ((x * y) - (a * (c * i))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[N[(x * y), $MachinePrecision], -4e+77], N[(2.0 * N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 2.8e+176], N[(2.0 * N[(N[(z * t), $MachinePrecision] - N[(c * N[(N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[(x * y), $MachinePrecision] - N[(a * N[(c * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \cdot y \leq -4 \cdot 10^{+77}:\\
\;\;\;\;2 \cdot \left(x \cdot y + z \cdot t\right)\\
\mathbf{elif}\;x \cdot y \leq 2.8 \cdot 10^{+176}:\\
\;\;\;\;2 \cdot \left(z \cdot t - c \cdot \left(\left(a + b \cdot c\right) \cdot i\right)\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(x \cdot y - a \cdot \left(c \cdot i\right)\right)\\
\end{array}
\end{array}
if (*.f64 x y) < -3.99999999999999993e77Initial program 100.0%
fma-define100.0%
*-commutative100.0%
associate-*l*100.0%
+-commutative100.0%
fma-define100.0%
Simplified100.0%
Taylor expanded in c around 0 82.8%
if -3.99999999999999993e77 < (*.f64 x y) < 2.8000000000000002e176Initial program 93.7%
fma-define93.7%
*-commutative93.7%
associate-*l*93.2%
+-commutative93.2%
fma-define93.2%
Simplified93.2%
Taylor expanded in x around 0 85.3%
if 2.8000000000000002e176 < (*.f64 x y) Initial program 78.3%
Taylor expanded in c around 0 75.3%
Taylor expanded in z around 0 72.2%
Taylor expanded in c around 0 81.5%
mul-1-neg81.5%
+-commutative81.5%
sub-neg81.5%
Simplified81.5%
Final simplification84.4%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* 2.0 (- (* z t) (* c (* b (* c i)))))))
(if (<= c -1.7e+48)
t_1
(if (<= c 5e+70)
(* 2.0 (+ (* x y) (* z t)))
(if (<= c 3.9e+210) t_1 (* -2.0 (* c (* (+ a (* b c)) i))))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = 2.0 * ((z * t) - (c * (b * (c * i))));
double tmp;
if (c <= -1.7e+48) {
tmp = t_1;
} else if (c <= 5e+70) {
tmp = 2.0 * ((x * y) + (z * t));
} else if (c <= 3.9e+210) {
tmp = t_1;
} else {
tmp = -2.0 * (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) :: t_1
real(8) :: tmp
t_1 = 2.0d0 * ((z * t) - (c * (b * (c * i))))
if (c <= (-1.7d+48)) then
tmp = t_1
else if (c <= 5d+70) then
tmp = 2.0d0 * ((x * y) + (z * t))
else if (c <= 3.9d+210) then
tmp = t_1
else
tmp = (-2.0d0) * (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 t_1 = 2.0 * ((z * t) - (c * (b * (c * i))));
double tmp;
if (c <= -1.7e+48) {
tmp = t_1;
} else if (c <= 5e+70) {
tmp = 2.0 * ((x * y) + (z * t));
} else if (c <= 3.9e+210) {
tmp = t_1;
} else {
tmp = -2.0 * (c * ((a + (b * c)) * i));
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = 2.0 * ((z * t) - (c * (b * (c * i)))) tmp = 0 if c <= -1.7e+48: tmp = t_1 elif c <= 5e+70: tmp = 2.0 * ((x * y) + (z * t)) elif c <= 3.9e+210: tmp = t_1 else: tmp = -2.0 * (c * ((a + (b * c)) * i)) return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(2.0 * Float64(Float64(z * t) - Float64(c * Float64(b * Float64(c * i))))) tmp = 0.0 if (c <= -1.7e+48) tmp = t_1; elseif (c <= 5e+70) tmp = Float64(2.0 * Float64(Float64(x * y) + Float64(z * t))); elseif (c <= 3.9e+210) tmp = t_1; else tmp = Float64(-2.0 * 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) t_1 = 2.0 * ((z * t) - (c * (b * (c * i)))); tmp = 0.0; if (c <= -1.7e+48) tmp = t_1; elseif (c <= 5e+70) tmp = 2.0 * ((x * y) + (z * t)); elseif (c <= 3.9e+210) tmp = t_1; else tmp = -2.0 * (c * ((a + (b * c)) * i)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(2.0 * N[(N[(z * t), $MachinePrecision] - N[(c * N[(b * N[(c * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[c, -1.7e+48], t$95$1, If[LessEqual[c, 5e+70], N[(2.0 * N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[c, 3.9e+210], t$95$1, N[(-2.0 * N[(c * N[(N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := 2 \cdot \left(z \cdot t - c \cdot \left(b \cdot \left(c \cdot i\right)\right)\right)\\
\mathbf{if}\;c \leq -1.7 \cdot 10^{+48}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;c \leq 5 \cdot 10^{+70}:\\
\;\;\;\;2 \cdot \left(x \cdot y + z \cdot t\right)\\
\mathbf{elif}\;c \leq 3.9 \cdot 10^{+210}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;-2 \cdot \left(c \cdot \left(\left(a + b \cdot c\right) \cdot i\right)\right)\\
\end{array}
\end{array}
if c < -1.7000000000000002e48 or 5.0000000000000002e70 < c < 3.9e210Initial program 84.7%
fma-define84.7%
*-commutative84.7%
associate-*l*94.4%
+-commutative94.4%
fma-define94.4%
Simplified94.4%
Taylor expanded in x around 0 91.2%
Taylor expanded in a around 0 80.5%
if -1.7000000000000002e48 < c < 5.0000000000000002e70Initial program 98.6%
fma-define98.6%
*-commutative98.6%
associate-*l*91.9%
+-commutative91.9%
fma-define91.9%
Simplified91.9%
Taylor expanded in c around 0 77.2%
if 3.9e210 < c Initial program 76.9%
fma-define76.9%
*-commutative76.9%
associate-*l*76.9%
+-commutative76.9%
fma-define76.9%
Simplified76.9%
Taylor expanded in i around inf 92.6%
Final simplification79.1%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* -2.0 (* c (* b (* c i))))))
(if (<= c -7.8e+112)
t_1
(if (<= c 1.25e-9)
(* t (* 2.0 z))
(if (<= c 8.2e+70) (* 2.0 (* x y)) 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 tmp;
if (c <= -7.8e+112) {
tmp = t_1;
} else if (c <= 1.25e-9) {
tmp = t * (2.0 * z);
} else if (c <= 8.2e+70) {
tmp = 2.0 * (x * y);
} 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 * (b * (c * i)))
if (c <= (-7.8d+112)) then
tmp = t_1
else if (c <= 1.25d-9) then
tmp = t * (2.0d0 * z)
else if (c <= 8.2d+70) then
tmp = 2.0d0 * (x * y)
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 tmp;
if (c <= -7.8e+112) {
tmp = t_1;
} else if (c <= 1.25e-9) {
tmp = t * (2.0 * z);
} else if (c <= 8.2e+70) {
tmp = 2.0 * (x * y);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = -2.0 * (c * (b * (c * i))) tmp = 0 if c <= -7.8e+112: tmp = t_1 elif c <= 1.25e-9: tmp = t * (2.0 * z) elif c <= 8.2e+70: tmp = 2.0 * (x * y) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(-2.0 * Float64(c * Float64(b * Float64(c * i)))) tmp = 0.0 if (c <= -7.8e+112) tmp = t_1; elseif (c <= 1.25e-9) tmp = Float64(t * Float64(2.0 * z)); elseif (c <= 8.2e+70) tmp = Float64(2.0 * Float64(x * y)); 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))); tmp = 0.0; if (c <= -7.8e+112) tmp = t_1; elseif (c <= 1.25e-9) tmp = t * (2.0 * z); elseif (c <= 8.2e+70) tmp = 2.0 * (x * y); 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[(b * N[(c * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[c, -7.8e+112], t$95$1, If[LessEqual[c, 1.25e-9], N[(t * N[(2.0 * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[c, 8.2e+70], N[(2.0 * N[(x * y), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := -2 \cdot \left(c \cdot \left(b \cdot \left(c \cdot i\right)\right)\right)\\
\mathbf{if}\;c \leq -7.8 \cdot 10^{+112}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;c \leq 1.25 \cdot 10^{-9}:\\
\;\;\;\;t \cdot \left(2 \cdot z\right)\\
\mathbf{elif}\;c \leq 8.2 \cdot 10^{+70}:\\
\;\;\;\;2 \cdot \left(x \cdot y\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if c < -7.79999999999999937e112 or 8.2000000000000004e70 < c Initial program 82.8%
fma-define82.8%
*-commutative82.8%
associate-*l*91.8%
+-commutative91.8%
fma-define91.8%
Simplified91.8%
Taylor expanded in i around inf 79.5%
Taylor expanded in a around 0 66.7%
if -7.79999999999999937e112 < c < 1.25e-9Initial program 98.1%
fma-define98.1%
*-commutative98.1%
associate-*l*91.4%
+-commutative91.4%
fma-define91.4%
Simplified91.4%
Taylor expanded in z around inf 47.2%
associate-*r*47.2%
*-commutative47.2%
associate-*l*47.2%
*-commutative47.2%
Simplified47.2%
if 1.25e-9 < c < 8.2000000000000004e70Initial program 93.3%
fma-define93.3%
*-commutative93.3%
associate-*l*99.9%
+-commutative99.9%
fma-define99.9%
Simplified99.9%
Taylor expanded in x around inf 54.5%
Final simplification54.1%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= c -6.2e+100) (not (<= c 6.6e+66))) (* -2.0 (* c (* (+ a (* b c)) i))) (* 2.0 (+ (* x y) (* z t)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((c <= -6.2e+100) || !(c <= 6.6e+66)) {
tmp = -2.0 * (c * ((a + (b * c)) * i));
} else {
tmp = 2.0 * ((x * y) + (z * t));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: tmp
if ((c <= (-6.2d+100)) .or. (.not. (c <= 6.6d+66))) then
tmp = (-2.0d0) * (c * ((a + (b * c)) * i))
else
tmp = 2.0d0 * ((x * y) + (z * t))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((c <= -6.2e+100) || !(c <= 6.6e+66)) {
tmp = -2.0 * (c * ((a + (b * c)) * i));
} else {
tmp = 2.0 * ((x * y) + (z * t));
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if (c <= -6.2e+100) or not (c <= 6.6e+66): tmp = -2.0 * (c * ((a + (b * c)) * i)) else: tmp = 2.0 * ((x * y) + (z * t)) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if ((c <= -6.2e+100) || !(c <= 6.6e+66)) tmp = Float64(-2.0 * Float64(c * Float64(Float64(a + Float64(b * c)) * i))); else tmp = Float64(2.0 * Float64(Float64(x * y) + Float64(z * t))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if ((c <= -6.2e+100) || ~((c <= 6.6e+66))) tmp = -2.0 * (c * ((a + (b * c)) * i)); else tmp = 2.0 * ((x * y) + (z * t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[c, -6.2e+100], N[Not[LessEqual[c, 6.6e+66]], $MachinePrecision]], N[(-2.0 * N[(c * N[(N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;c \leq -6.2 \cdot 10^{+100} \lor \neg \left(c \leq 6.6 \cdot 10^{+66}\right):\\
\;\;\;\;-2 \cdot \left(c \cdot \left(\left(a + b \cdot c\right) \cdot i\right)\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(x \cdot y + z \cdot t\right)\\
\end{array}
\end{array}
if c < -6.20000000000000014e100 or 6.6000000000000003e66 < c Initial program 84.1%
fma-define84.1%
*-commutative84.1%
associate-*l*92.4%
+-commutative92.4%
fma-define92.4%
Simplified92.4%
Taylor expanded in i around inf 77.8%
if -6.20000000000000014e100 < c < 6.6000000000000003e66Initial program 97.5%
fma-define97.5%
*-commutative97.5%
associate-*l*91.8%
+-commutative91.8%
fma-define91.8%
Simplified91.8%
Taylor expanded in c around 0 76.8%
Final simplification77.2%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= c -8.5e+112) (not (<= c 1.3e+71))) (* -2.0 (* c (* b (* c i)))) (* 2.0 (+ (* x y) (* z t)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((c <= -8.5e+112) || !(c <= 1.3e+71)) {
tmp = -2.0 * (c * (b * (c * i)));
} else {
tmp = 2.0 * ((x * y) + (z * t));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: tmp
if ((c <= (-8.5d+112)) .or. (.not. (c <= 1.3d+71))) then
tmp = (-2.0d0) * (c * (b * (c * i)))
else
tmp = 2.0d0 * ((x * y) + (z * t))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((c <= -8.5e+112) || !(c <= 1.3e+71)) {
tmp = -2.0 * (c * (b * (c * i)));
} else {
tmp = 2.0 * ((x * y) + (z * t));
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if (c <= -8.5e+112) or not (c <= 1.3e+71): tmp = -2.0 * (c * (b * (c * i))) else: tmp = 2.0 * ((x * y) + (z * t)) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if ((c <= -8.5e+112) || !(c <= 1.3e+71)) tmp = Float64(-2.0 * Float64(c * Float64(b * Float64(c * i)))); else tmp = Float64(2.0 * Float64(Float64(x * y) + Float64(z * t))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if ((c <= -8.5e+112) || ~((c <= 1.3e+71))) tmp = -2.0 * (c * (b * (c * i))); else tmp = 2.0 * ((x * y) + (z * t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[c, -8.5e+112], N[Not[LessEqual[c, 1.3e+71]], $MachinePrecision]], N[(-2.0 * N[(c * N[(b * N[(c * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;c \leq -8.5 \cdot 10^{+112} \lor \neg \left(c \leq 1.3 \cdot 10^{+71}\right):\\
\;\;\;\;-2 \cdot \left(c \cdot \left(b \cdot \left(c \cdot i\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(x \cdot y + z \cdot t\right)\\
\end{array}
\end{array}
if c < -8.50000000000000047e112 or 1.29999999999999996e71 < c Initial program 82.8%
fma-define82.8%
*-commutative82.8%
associate-*l*91.8%
+-commutative91.8%
fma-define91.8%
Simplified91.8%
Taylor expanded in i around inf 79.5%
Taylor expanded in a around 0 66.7%
if -8.50000000000000047e112 < c < 1.29999999999999996e71Initial program 97.6%
fma-define97.6%
*-commutative97.6%
associate-*l*92.1%
+-commutative92.1%
fma-define92.1%
Simplified92.1%
Taylor expanded in c around 0 75.4%
Final simplification72.5%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= (* x y) -1.4e+77) (not (<= (* x y) 7e+41))) (* 2.0 (* x y)) (* t (* 2.0 z))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (((x * y) <= -1.4e+77) || !((x * y) <= 7e+41)) {
tmp = 2.0 * (x * y);
} else {
tmp = t * (2.0 * z);
}
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.4d+77)) .or. (.not. ((x * y) <= 7d+41))) then
tmp = 2.0d0 * (x * y)
else
tmp = t * (2.0d0 * z)
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.4e+77) || !((x * y) <= 7e+41)) {
tmp = 2.0 * (x * y);
} else {
tmp = t * (2.0 * z);
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if ((x * y) <= -1.4e+77) or not ((x * y) <= 7e+41): tmp = 2.0 * (x * y) else: tmp = t * (2.0 * z) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if ((Float64(x * y) <= -1.4e+77) || !(Float64(x * y) <= 7e+41)) tmp = Float64(2.0 * Float64(x * y)); else tmp = Float64(t * Float64(2.0 * z)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if (((x * y) <= -1.4e+77) || ~(((x * y) <= 7e+41))) tmp = 2.0 * (x * y); else tmp = t * (2.0 * z); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[N[(x * y), $MachinePrecision], -1.4e+77], N[Not[LessEqual[N[(x * y), $MachinePrecision], 7e+41]], $MachinePrecision]], N[(2.0 * N[(x * y), $MachinePrecision]), $MachinePrecision], N[(t * N[(2.0 * z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \cdot y \leq -1.4 \cdot 10^{+77} \lor \neg \left(x \cdot y \leq 7 \cdot 10^{+41}\right):\\
\;\;\;\;2 \cdot \left(x \cdot y\right)\\
\mathbf{else}:\\
\;\;\;\;t \cdot \left(2 \cdot z\right)\\
\end{array}
\end{array}
if (*.f64 x y) < -1.4e77 or 6.9999999999999998e41 < (*.f64 x y) Initial program 90.6%
fma-define90.6%
*-commutative90.6%
associate-*l*88.6%
+-commutative88.6%
fma-define88.6%
Simplified88.6%
Taylor expanded in x around inf 60.2%
if -1.4e77 < (*.f64 x y) < 6.9999999999999998e41Initial program 93.9%
fma-define93.9%
*-commutative93.9%
associate-*l*94.0%
+-commutative94.0%
fma-define94.0%
Simplified94.0%
Taylor expanded in z around inf 47.7%
associate-*r*47.7%
*-commutative47.7%
associate-*l*47.7%
*-commutative47.7%
Simplified47.7%
Final simplification52.3%
(FPCore (x y z t a b c i) :precision binary64 (* 2.0 (* x y)))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return 2.0 * (x * y);
}
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)
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);
}
def code(x, y, z, t, a, b, c, i): return 2.0 * (x * y)
function code(x, y, z, t, a, b, c, i) return Float64(2.0 * Float64(x * y)) end
function tmp = code(x, y, z, t, a, b, c, i) tmp = 2.0 * (x * y); end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(2.0 * N[(x * y), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
2 \cdot \left(x \cdot y\right)
\end{array}
Initial program 92.7%
fma-define92.7%
*-commutative92.7%
associate-*l*92.0%
+-commutative92.0%
fma-define92.0%
Simplified92.0%
Taylor expanded in x around inf 27.1%
(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 2024150
(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))))