
(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 11 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))))
(* -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 95.2%
fma-def95.2%
associate-*l*99.9%
Simplified99.9%
fma-def99.9%
+-commutative99.9%
Applied egg-rr99.9%
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 z around 0 36.4%
Taylor expanded in x around 0 63.6%
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)) (t_3 (* c (* t_1 i))))
(if (<= t_2 (- INFINITY))
(* 2.0 (- (* x y) t_3))
(if (<= t_2 1e+261) (* (- (+ (* x y) (* z t)) t_2) 2.0) (* -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 * ((x * y) - t_3);
} else if (t_2 <= 1e+261) {
tmp = (((x * y) + (z * t)) - t_2) * 2.0;
} 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 * ((x * y) - t_3);
} else if (t_2 <= 1e+261) {
tmp = (((x * y) + (z * t)) - t_2) * 2.0;
} 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 * ((x * y) - t_3) elif t_2 <= 1e+261: tmp = (((x * y) + (z * t)) - t_2) * 2.0 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(x * y) - t_3)); elseif (t_2 <= 1e+261) tmp = Float64(Float64(Float64(Float64(x * y) + Float64(z * t)) - t_2) * 2.0); 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 * ((x * y) - t_3); elseif (t_2 <= 1e+261) tmp = (((x * y) + (z * t)) - t_2) * 2.0; 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[(x * y), $MachinePrecision] - t$95$3), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, 1e+261], N[(N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] - t$95$2), $MachinePrecision] * 2.0), $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(x \cdot y - t_3\right)\\
\mathbf{elif}\;t_2 \leq 10^{+261}:\\
\;\;\;\;\left(\left(x \cdot y + z \cdot t\right) - t_2\right) \cdot 2\\
\mathbf{else}:\\
\;\;\;\;-2 \cdot t_3\\
\end{array}
\end{array}
if (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < -inf.0Initial program 79.7%
Taylor expanded in z around 0 95.5%
if -inf.0 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 9.9999999999999993e260Initial program 98.5%
if 9.9999999999999993e260 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) Initial program 80.2%
Taylor expanded in z around 0 88.1%
Taylor expanded in x around 0 91.5%
Final simplification96.4%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* 2.0 (* z t)))
(t_2 (* (* c i) (* a -2.0)))
(t_3 (* (* x y) 2.0)))
(if (<= (* x y) -1e+121)
t_3
(if (<= (* x y) -4e-256)
t_1
(if (<= (* x y) 4e-263)
t_2
(if (<= (* x y) 2e-87) t_1 (if (<= (* x y) 5e+62) t_2 t_3)))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = 2.0 * (z * t);
double t_2 = (c * i) * (a * -2.0);
double t_3 = (x * y) * 2.0;
double tmp;
if ((x * y) <= -1e+121) {
tmp = t_3;
} else if ((x * y) <= -4e-256) {
tmp = t_1;
} else if ((x * y) <= 4e-263) {
tmp = t_2;
} else if ((x * y) <= 2e-87) {
tmp = t_1;
} else if ((x * y) <= 5e+62) {
tmp = t_2;
} else {
tmp = t_3;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: tmp
t_1 = 2.0d0 * (z * t)
t_2 = (c * i) * (a * (-2.0d0))
t_3 = (x * y) * 2.0d0
if ((x * y) <= (-1d+121)) then
tmp = t_3
else if ((x * y) <= (-4d-256)) then
tmp = t_1
else if ((x * y) <= 4d-263) then
tmp = t_2
else if ((x * y) <= 2d-87) then
tmp = t_1
else if ((x * y) <= 5d+62) then
tmp = t_2
else
tmp = t_3
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = 2.0 * (z * t);
double t_2 = (c * i) * (a * -2.0);
double t_3 = (x * y) * 2.0;
double tmp;
if ((x * y) <= -1e+121) {
tmp = t_3;
} else if ((x * y) <= -4e-256) {
tmp = t_1;
} else if ((x * y) <= 4e-263) {
tmp = t_2;
} else if ((x * y) <= 2e-87) {
tmp = t_1;
} else if ((x * y) <= 5e+62) {
tmp = t_2;
} else {
tmp = t_3;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = 2.0 * (z * t) t_2 = (c * i) * (a * -2.0) t_3 = (x * y) * 2.0 tmp = 0 if (x * y) <= -1e+121: tmp = t_3 elif (x * y) <= -4e-256: tmp = t_1 elif (x * y) <= 4e-263: tmp = t_2 elif (x * y) <= 2e-87: tmp = t_1 elif (x * y) <= 5e+62: tmp = t_2 else: tmp = t_3 return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(2.0 * Float64(z * t)) t_2 = Float64(Float64(c * i) * Float64(a * -2.0)) t_3 = Float64(Float64(x * y) * 2.0) tmp = 0.0 if (Float64(x * y) <= -1e+121) tmp = t_3; elseif (Float64(x * y) <= -4e-256) tmp = t_1; elseif (Float64(x * y) <= 4e-263) tmp = t_2; elseif (Float64(x * y) <= 2e-87) tmp = t_1; elseif (Float64(x * y) <= 5e+62) tmp = t_2; else tmp = t_3; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = 2.0 * (z * t); t_2 = (c * i) * (a * -2.0); t_3 = (x * y) * 2.0; tmp = 0.0; if ((x * y) <= -1e+121) tmp = t_3; elseif ((x * y) <= -4e-256) tmp = t_1; elseif ((x * y) <= 4e-263) tmp = t_2; elseif ((x * y) <= 2e-87) tmp = t_1; elseif ((x * y) <= 5e+62) tmp = t_2; else tmp = t_3; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(2.0 * N[(z * t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(c * i), $MachinePrecision] * N[(a * -2.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(x * y), $MachinePrecision] * 2.0), $MachinePrecision]}, If[LessEqual[N[(x * y), $MachinePrecision], -1e+121], t$95$3, If[LessEqual[N[(x * y), $MachinePrecision], -4e-256], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], 4e-263], t$95$2, If[LessEqual[N[(x * y), $MachinePrecision], 2e-87], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], 5e+62], t$95$2, t$95$3]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := 2 \cdot \left(z \cdot t\right)\\
t_2 := \left(c \cdot i\right) \cdot \left(a \cdot -2\right)\\
t_3 := \left(x \cdot y\right) \cdot 2\\
\mathbf{if}\;x \cdot y \leq -1 \cdot 10^{+121}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;x \cdot y \leq -4 \cdot 10^{-256}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \cdot y \leq 4 \cdot 10^{-263}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;x \cdot y \leq 2 \cdot 10^{-87}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \cdot y \leq 5 \cdot 10^{+62}:\\
\;\;\;\;t_2\\
\mathbf{else}:\\
\;\;\;\;t_3\\
\end{array}
\end{array}
if (*.f64 x y) < -1.00000000000000004e121 or 5.00000000000000029e62 < (*.f64 x y) Initial program 89.7%
Taylor expanded in x around inf 59.7%
if -1.00000000000000004e121 < (*.f64 x y) < -3.99999999999999991e-256 or 4e-263 < (*.f64 x y) < 2.00000000000000004e-87Initial program 92.1%
Taylor expanded in z around inf 42.2%
if -3.99999999999999991e-256 < (*.f64 x y) < 4e-263 or 2.00000000000000004e-87 < (*.f64 x y) < 5.00000000000000029e62Initial program 91.9%
Taylor expanded in z around 0 73.4%
Taylor expanded in a around inf 43.2%
associate-*r*43.2%
Simplified43.2%
Final simplification49.1%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= c -1.96e-16) (not (<= c 4.8e-52))) (* 2.0 (- (* x y) (* 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.96e-16) || !(c <= 4.8e-52)) {
tmp = 2.0 * ((x * y) - (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.96d-16)) .or. (.not. (c <= 4.8d-52))) then
tmp = 2.0d0 * ((x * y) - (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.96e-16) || !(c <= 4.8e-52)) {
tmp = 2.0 * ((x * y) - (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.96e-16) or not (c <= 4.8e-52): tmp = 2.0 * ((x * y) - (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.96e-16) || !(c <= 4.8e-52)) tmp = Float64(2.0 * Float64(Float64(x * y) - 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.96e-16) || ~((c <= 4.8e-52))) tmp = 2.0 * ((x * y) - (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.96e-16], N[Not[LessEqual[c, 4.8e-52]], $MachinePrecision]], N[(2.0 * N[(N[(x * y), $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 -1.96 \cdot 10^{-16} \lor \neg \left(c \leq 4.8 \cdot 10^{-52}\right):\\
\;\;\;\;2 \cdot \left(x \cdot y - 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.96000000000000005e-16 or 4.8000000000000003e-52 < c Initial program 85.7%
Taylor expanded in z around 0 85.7%
if -1.96000000000000005e-16 < c < 4.8000000000000003e-52Initial program 97.4%
Taylor expanded in c around 0 82.1%
Final simplification84.0%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= c -7.9e-16) (not (<= c 4.8e+86))) (* 2.0 (- (* x y) (* c (* (+ a (* b c)) i)))) (* 2.0 (- (+ (* x y) (* z t)) (* a (* c i))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((c <= -7.9e-16) || !(c <= 4.8e+86)) {
tmp = 2.0 * ((x * y) - (c * ((a + (b * c)) * i)));
} else {
tmp = 2.0 * (((x * y) + (z * t)) - (a * (c * i)));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: tmp
if ((c <= (-7.9d-16)) .or. (.not. (c <= 4.8d+86))) then
tmp = 2.0d0 * ((x * y) - (c * ((a + (b * c)) * i)))
else
tmp = 2.0d0 * (((x * y) + (z * t)) - (a * (c * i)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((c <= -7.9e-16) || !(c <= 4.8e+86)) {
tmp = 2.0 * ((x * y) - (c * ((a + (b * c)) * i)));
} else {
tmp = 2.0 * (((x * y) + (z * t)) - (a * (c * i)));
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if (c <= -7.9e-16) or not (c <= 4.8e+86): tmp = 2.0 * ((x * y) - (c * ((a + (b * c)) * i))) else: tmp = 2.0 * (((x * y) + (z * t)) - (a * (c * i))) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if ((c <= -7.9e-16) || !(c <= 4.8e+86)) tmp = Float64(2.0 * Float64(Float64(x * y) - Float64(c * Float64(Float64(a + Float64(b * c)) * i)))); else tmp = Float64(2.0 * Float64(Float64(Float64(x * y) + Float64(z * t)) - Float64(a * Float64(c * i)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if ((c <= -7.9e-16) || ~((c <= 4.8e+86))) tmp = 2.0 * ((x * y) - (c * ((a + (b * c)) * i))); else tmp = 2.0 * (((x * y) + (z * t)) - (a * (c * i))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[c, -7.9e-16], N[Not[LessEqual[c, 4.8e+86]], $MachinePrecision]], N[(2.0 * N[(N[(x * y), $MachinePrecision] - N[(c * N[(N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] - N[(a * N[(c * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;c \leq -7.9 \cdot 10^{-16} \lor \neg \left(c \leq 4.8 \cdot 10^{+86}\right):\\
\;\;\;\;2 \cdot \left(x \cdot y - c \cdot \left(\left(a + b \cdot c\right) \cdot i\right)\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(\left(x \cdot y + z \cdot t\right) - a \cdot \left(c \cdot i\right)\right)\\
\end{array}
\end{array}
if c < -7.9000000000000002e-16 or 4.8000000000000001e86 < c Initial program 86.2%
Taylor expanded in z around 0 90.8%
if -7.9000000000000002e-16 < c < 4.8000000000000001e86Initial program 94.7%
Taylor expanded in a around inf 90.3%
Final simplification90.5%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* -2.0 (* c (* b (* c i))))))
(if (<= c -7.9e-16)
t_1
(if (<= c -3.2e-212)
(* 2.0 (* z t))
(if (<= c 3.4e-78)
(* (* x y) 2.0)
(if (<= c 9e+155) (* i (* a (* c -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 * (c * (b * (c * i)));
double tmp;
if (c <= -7.9e-16) {
tmp = t_1;
} else if (c <= -3.2e-212) {
tmp = 2.0 * (z * t);
} else if (c <= 3.4e-78) {
tmp = (x * y) * 2.0;
} else if (c <= 9e+155) {
tmp = i * (a * (c * -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) * (c * (b * (c * i)))
if (c <= (-7.9d-16)) then
tmp = t_1
else if (c <= (-3.2d-212)) then
tmp = 2.0d0 * (z * t)
else if (c <= 3.4d-78) then
tmp = (x * y) * 2.0d0
else if (c <= 9d+155) then
tmp = i * (a * (c * (-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 * (c * (b * (c * i)));
double tmp;
if (c <= -7.9e-16) {
tmp = t_1;
} else if (c <= -3.2e-212) {
tmp = 2.0 * (z * t);
} else if (c <= 3.4e-78) {
tmp = (x * y) * 2.0;
} else if (c <= 9e+155) {
tmp = i * (a * (c * -2.0));
} 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.9e-16: tmp = t_1 elif c <= -3.2e-212: tmp = 2.0 * (z * t) elif c <= 3.4e-78: tmp = (x * y) * 2.0 elif c <= 9e+155: tmp = i * (a * (c * -2.0)) 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.9e-16) tmp = t_1; elseif (c <= -3.2e-212) tmp = Float64(2.0 * Float64(z * t)); elseif (c <= 3.4e-78) tmp = Float64(Float64(x * y) * 2.0); elseif (c <= 9e+155) tmp = Float64(i * Float64(a * Float64(c * -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 * (c * (b * (c * i))); tmp = 0.0; if (c <= -7.9e-16) tmp = t_1; elseif (c <= -3.2e-212) tmp = 2.0 * (z * t); elseif (c <= 3.4e-78) tmp = (x * y) * 2.0; elseif (c <= 9e+155) tmp = i * (a * (c * -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[(c * N[(b * N[(c * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[c, -7.9e-16], t$95$1, If[LessEqual[c, -3.2e-212], N[(2.0 * N[(z * t), $MachinePrecision]), $MachinePrecision], If[LessEqual[c, 3.4e-78], N[(N[(x * y), $MachinePrecision] * 2.0), $MachinePrecision], If[LessEqual[c, 9e+155], N[(i * N[(a * N[(c * -2.0), $MachinePrecision]), $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.9 \cdot 10^{-16}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;c \leq -3.2 \cdot 10^{-212}:\\
\;\;\;\;2 \cdot \left(z \cdot t\right)\\
\mathbf{elif}\;c \leq 3.4 \cdot 10^{-78}:\\
\;\;\;\;\left(x \cdot y\right) \cdot 2\\
\mathbf{elif}\;c \leq 9 \cdot 10^{+155}:\\
\;\;\;\;i \cdot \left(a \cdot \left(c \cdot -2\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if c < -7.9000000000000002e-16 or 8.99999999999999947e155 < c Initial program 86.3%
Taylor expanded in z around 0 90.3%
Taylor expanded in x around 0 87.0%
Taylor expanded in a around 0 68.2%
if -7.9000000000000002e-16 < c < -3.1999999999999999e-212Initial program 100.0%
Taylor expanded in z around inf 50.4%
if -3.1999999999999999e-212 < c < 3.40000000000000012e-78Initial program 95.5%
Taylor expanded in x around inf 54.0%
if 3.40000000000000012e-78 < c < 8.99999999999999947e155Initial program 86.1%
Taylor expanded in z around 0 65.6%
Taylor expanded in a around inf 42.5%
associate-*r*42.5%
Simplified42.5%
Taylor expanded in a around 0 42.5%
associate-*r*42.5%
*-commutative42.5%
associate-*l*44.8%
*-commutative44.8%
associate-*l*44.8%
Simplified44.8%
Final simplification57.4%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* -2.0 (* c (* (+ a (* b c)) i)))))
(if (<= c -6.8e-16)
t_1
(if (<= c 6.4e-77)
(* (+ (* x y) (* z t)) 2.0)
(if (<= c 1.05e+100) (* 2.0 (- (* z t) (* 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 <= -6.8e-16) {
tmp = t_1;
} else if (c <= 6.4e-77) {
tmp = ((x * y) + (z * t)) * 2.0;
} else if (c <= 1.05e+100) {
tmp = 2.0 * ((z * t) - (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 <= (-6.8d-16)) then
tmp = t_1
else if (c <= 6.4d-77) then
tmp = ((x * y) + (z * t)) * 2.0d0
else if (c <= 1.05d+100) then
tmp = 2.0d0 * ((z * t) - (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 <= -6.8e-16) {
tmp = t_1;
} else if (c <= 6.4e-77) {
tmp = ((x * y) + (z * t)) * 2.0;
} else if (c <= 1.05e+100) {
tmp = 2.0 * ((z * t) - (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 <= -6.8e-16: tmp = t_1 elif c <= 6.4e-77: tmp = ((x * y) + (z * t)) * 2.0 elif c <= 1.05e+100: tmp = 2.0 * ((z * t) - (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 <= -6.8e-16) tmp = t_1; elseif (c <= 6.4e-77) tmp = Float64(Float64(Float64(x * y) + Float64(z * t)) * 2.0); elseif (c <= 1.05e+100) tmp = Float64(2.0 * Float64(Float64(z * t) - 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 <= -6.8e-16) tmp = t_1; elseif (c <= 6.4e-77) tmp = ((x * y) + (z * t)) * 2.0; elseif (c <= 1.05e+100) tmp = 2.0 * ((z * t) - (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, -6.8e-16], t$95$1, If[LessEqual[c, 6.4e-77], N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision], If[LessEqual[c, 1.05e+100], N[(2.0 * N[(N[(z * t), $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 -6.8 \cdot 10^{-16}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;c \leq 6.4 \cdot 10^{-77}:\\
\;\;\;\;\left(x \cdot y + z \cdot t\right) \cdot 2\\
\mathbf{elif}\;c \leq 1.05 \cdot 10^{+100}:\\
\;\;\;\;2 \cdot \left(z \cdot t - a \cdot \left(c \cdot i\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if c < -6.8e-16 or 1.0499999999999999e100 < c Initial program 85.9%
Taylor expanded in z around 0 90.6%
Taylor expanded in x around 0 85.6%
if -6.8e-16 < c < 6.39999999999999999e-77Initial program 97.2%
Taylor expanded in c around 0 82.9%
if 6.39999999999999999e-77 < c < 1.0499999999999999e100Initial program 87.3%
fma-def87.3%
associate-*l*94.7%
Simplified94.7%
fma-def94.7%
+-commutative94.7%
Applied egg-rr94.7%
Taylor expanded in a around inf 82.1%
Taylor expanded in x around 0 74.6%
Final simplification82.7%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= c -7.9e-16) (not (<= c 1.25e-47))) (* -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 <= -7.9e-16) || !(c <= 1.25e-47)) {
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 <= (-7.9d-16)) .or. (.not. (c <= 1.25d-47))) 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 <= -7.9e-16) || !(c <= 1.25e-47)) {
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 <= -7.9e-16) or not (c <= 1.25e-47): 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 <= -7.9e-16) || !(c <= 1.25e-47)) 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 <= -7.9e-16) || ~((c <= 1.25e-47))) 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, -7.9e-16], N[Not[LessEqual[c, 1.25e-47]], $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 -7.9 \cdot 10^{-16} \lor \neg \left(c \leq 1.25 \cdot 10^{-47}\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 < -7.9000000000000002e-16 or 1.25000000000000003e-47 < c Initial program 85.7%
Taylor expanded in z around 0 85.7%
Taylor expanded in x around 0 79.8%
if -7.9000000000000002e-16 < c < 1.25000000000000003e-47Initial program 97.4%
Taylor expanded in c around 0 82.1%
Final simplification80.9%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= (* x y) -1e+121) (not (<= (* x y) 2e+47))) (* (* 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) <= -1e+121) || !((x * y) <= 2e+47)) {
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) <= (-1d+121)) .or. (.not. ((x * y) <= 2d+47))) 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) <= -1e+121) || !((x * y) <= 2e+47)) {
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) <= -1e+121) or not ((x * y) <= 2e+47): 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) <= -1e+121) || !(Float64(x * y) <= 2e+47)) 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) <= -1e+121) || ~(((x * y) <= 2e+47))) 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], -1e+121], N[Not[LessEqual[N[(x * y), $MachinePrecision], 2e+47]], $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 \cdot 10^{+121} \lor \neg \left(x \cdot y \leq 2 \cdot 10^{+47}\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.00000000000000004e121 or 2.0000000000000001e47 < (*.f64 x y) Initial program 90.0%
Taylor expanded in x around inf 59.0%
if -1.00000000000000004e121 < (*.f64 x y) < 2.0000000000000001e47Initial program 91.9%
Taylor expanded in z around inf 36.9%
Final simplification45.4%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= c -7400.0) (not (<= c 8.5e+155))) (* -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 <= -7400.0) || !(c <= 8.5e+155)) {
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 <= (-7400.0d0)) .or. (.not. (c <= 8.5d+155))) 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 <= -7400.0) || !(c <= 8.5e+155)) {
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 <= -7400.0) or not (c <= 8.5e+155): 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 <= -7400.0) || !(c <= 8.5e+155)) tmp = Float64(-2.0 * Float64(c * Float64(b * 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 <= -7400.0) || ~((c <= 8.5e+155))) 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, -7400.0], N[Not[LessEqual[c, 8.5e+155]], $MachinePrecision]], N[(-2.0 * N[(c * N[(b * N[(c * 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 -7400 \lor \neg \left(c \leq 8.5 \cdot 10^{+155}\right):\\
\;\;\;\;-2 \cdot \left(c \cdot \left(b \cdot \left(c \cdot i\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(x \cdot y + z \cdot t\right) \cdot 2\\
\end{array}
\end{array}
if c < -7400 or 8.5000000000000002e155 < c Initial program 85.6%
Taylor expanded in z around 0 90.2%
Taylor expanded in x around 0 88.8%
Taylor expanded in a around 0 69.6%
if -7400 < c < 8.5000000000000002e155Initial program 94.4%
Taylor expanded in c around 0 73.6%
Final simplification72.1%
(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 91.1%
Taylor expanded in z around inf 28.3%
Final simplification28.3%
(FPCore (x y z t a b c i) :precision binary64 (* 2.0 (- (+ (* x y) (* z t)) (* (+ a (* b c)) (* c i)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return 2.0 * (((x * y) + (z * t)) - ((a + (b * c)) * (c * i)));
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
code = 2.0d0 * (((x * y) + (z * t)) - ((a + (b * c)) * (c * i)))
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return 2.0 * (((x * y) + (z * t)) - ((a + (b * c)) * (c * i)));
}
def code(x, y, z, t, a, b, c, i): return 2.0 * (((x * y) + (z * t)) - ((a + (b * c)) * (c * i)))
function code(x, y, z, t, a, b, c, i) return Float64(2.0 * Float64(Float64(Float64(x * y) + Float64(z * t)) - Float64(Float64(a + Float64(b * c)) * Float64(c * i)))) end
function tmp = code(x, y, z, t, a, b, c, i) tmp = 2.0 * (((x * y) + (z * t)) - ((a + (b * c)) * (c * i))); end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(2.0 * N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] - N[(N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision] * N[(c * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
2 \cdot \left(\left(x \cdot y + z \cdot t\right) - \left(a + b \cdot c\right) \cdot \left(c \cdot i\right)\right)
\end{array}
herbie shell --seed 2024024
(FPCore (x y z t a b c i)
:name "Diagrams.ThreeD.Shapes:frustum from diagrams-lib-1.3.0.3, A"
:precision binary64
:herbie-target
(* 2.0 (- (+ (* x y) (* z t)) (* (+ a (* b c)) (* c i))))
(* 2.0 (- (+ (* x y) (* z t)) (* (* (+ a (* b c)) c) i))))