
(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 14 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 (* 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}
Initial program 90.9%
associate-*l*97.6%
Applied egg-rr97.6%
(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)))
(if (<= t_3 (- INFINITY))
(* 2.0 (- (* x y) t_2))
(if (<= t_3 5e+261)
(* 2.0 (- (+ (* x y) (* z t)) (* i t_3)))
(* 2.0 (- (* z t) t_2))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = a + (b * c);
double t_2 = c * (t_1 * i);
double t_3 = c * t_1;
double tmp;
if (t_3 <= -((double) INFINITY)) {
tmp = 2.0 * ((x * y) - t_2);
} else if (t_3 <= 5e+261) {
tmp = 2.0 * (((x * y) + (z * t)) - (i * t_3));
} else {
tmp = 2.0 * ((z * t) - t_2);
}
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;
double tmp;
if (t_3 <= -Double.POSITIVE_INFINITY) {
tmp = 2.0 * ((x * y) - t_2);
} else if (t_3 <= 5e+261) {
tmp = 2.0 * (((x * y) + (z * t)) - (i * t_3));
} else {
tmp = 2.0 * ((z * t) - t_2);
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = a + (b * c) t_2 = c * (t_1 * i) t_3 = c * t_1 tmp = 0 if t_3 <= -math.inf: tmp = 2.0 * ((x * y) - t_2) elif t_3 <= 5e+261: tmp = 2.0 * (((x * y) + (z * t)) - (i * t_3)) else: tmp = 2.0 * ((z * t) - t_2) return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(a + Float64(b * c)) t_2 = Float64(c * Float64(t_1 * i)) t_3 = Float64(c * t_1) tmp = 0.0 if (t_3 <= Float64(-Inf)) tmp = Float64(2.0 * Float64(Float64(x * y) - t_2)); elseif (t_3 <= 5e+261) tmp = Float64(2.0 * Float64(Float64(Float64(x * y) + Float64(z * t)) - Float64(i * t_3))); else tmp = Float64(2.0 * Float64(Float64(z * t) - t_2)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = a + (b * c); t_2 = c * (t_1 * i); t_3 = c * t_1; tmp = 0.0; if (t_3 <= -Inf) tmp = 2.0 * ((x * y) - t_2); elseif (t_3 <= 5e+261) tmp = 2.0 * (((x * y) + (z * t)) - (i * t_3)); else tmp = 2.0 * ((z * t) - t_2); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(c * N[(t$95$1 * i), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(c * t$95$1), $MachinePrecision]}, If[LessEqual[t$95$3, (-Infinity)], N[(2.0 * N[(N[(x * y), $MachinePrecision] - t$95$2), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$3, 5e+261], N[(2.0 * N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] - N[(i * t$95$3), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[(z * t), $MachinePrecision] - t$95$2), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a + b \cdot c\\
t_2 := c \cdot \left(t\_1 \cdot i\right)\\
t_3 := c \cdot t\_1\\
\mathbf{if}\;t\_3 \leq -\infty:\\
\;\;\;\;2 \cdot \left(x \cdot y - t\_2\right)\\
\mathbf{elif}\;t\_3 \leq 5 \cdot 10^{+261}:\\
\;\;\;\;2 \cdot \left(\left(x \cdot y + z \cdot t\right) - i \cdot t\_3\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(z \cdot t - t\_2\right)\\
\end{array}
\end{array}
if (*.f64 (+.f64 a (*.f64 b c)) c) < -inf.0Initial program 68.3%
Taylor expanded in z around 0 86.2%
if -inf.0 < (*.f64 (+.f64 a (*.f64 b c)) c) < 5.0000000000000001e261Initial program 99.9%
if 5.0000000000000001e261 < (*.f64 (+.f64 a (*.f64 b c)) c) Initial program 73.6%
Taylor expanded in x around 0 97.1%
Final simplification97.2%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* c (* (+ a (* b c)) i))) (t_2 (* 2.0 (- (* z t) t_1))))
(if (<= c -1.58e-86)
t_2
(if (<= c 1e-108)
(* 2.0 (+ (* x y) (* z t)))
(if (<= c 7.6e+61) (* 2.0 (- (* x y) t_1)) t_2)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = c * ((a + (b * c)) * i);
double t_2 = 2.0 * ((z * t) - t_1);
double tmp;
if (c <= -1.58e-86) {
tmp = t_2;
} else if (c <= 1e-108) {
tmp = 2.0 * ((x * y) + (z * t));
} else if (c <= 7.6e+61) {
tmp = 2.0 * ((x * y) - t_1);
} else {
tmp = t_2;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = c * ((a + (b * c)) * i)
t_2 = 2.0d0 * ((z * t) - t_1)
if (c <= (-1.58d-86)) then
tmp = t_2
else if (c <= 1d-108) then
tmp = 2.0d0 * ((x * y) + (z * t))
else if (c <= 7.6d+61) then
tmp = 2.0d0 * ((x * y) - t_1)
else
tmp = t_2
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = c * ((a + (b * c)) * i);
double t_2 = 2.0 * ((z * t) - t_1);
double tmp;
if (c <= -1.58e-86) {
tmp = t_2;
} else if (c <= 1e-108) {
tmp = 2.0 * ((x * y) + (z * t));
} else if (c <= 7.6e+61) {
tmp = 2.0 * ((x * y) - t_1);
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = c * ((a + (b * c)) * i) t_2 = 2.0 * ((z * t) - t_1) tmp = 0 if c <= -1.58e-86: tmp = t_2 elif c <= 1e-108: tmp = 2.0 * ((x * y) + (z * t)) elif c <= 7.6e+61: tmp = 2.0 * ((x * y) - t_1) else: tmp = t_2 return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(c * Float64(Float64(a + Float64(b * c)) * i)) t_2 = Float64(2.0 * Float64(Float64(z * t) - t_1)) tmp = 0.0 if (c <= -1.58e-86) tmp = t_2; elseif (c <= 1e-108) tmp = Float64(2.0 * Float64(Float64(x * y) + Float64(z * t))); elseif (c <= 7.6e+61) tmp = Float64(2.0 * Float64(Float64(x * y) - t_1)); else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = c * ((a + (b * c)) * i); t_2 = 2.0 * ((z * t) - t_1); tmp = 0.0; if (c <= -1.58e-86) tmp = t_2; elseif (c <= 1e-108) tmp = 2.0 * ((x * y) + (z * t)); elseif (c <= 7.6e+61) tmp = 2.0 * ((x * y) - t_1); else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(c * N[(N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(2.0 * N[(N[(z * t), $MachinePrecision] - t$95$1), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[c, -1.58e-86], t$95$2, If[LessEqual[c, 1e-108], N[(2.0 * N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[c, 7.6e+61], N[(2.0 * N[(N[(x * y), $MachinePrecision] - t$95$1), $MachinePrecision]), $MachinePrecision], t$95$2]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := c \cdot \left(\left(a + b \cdot c\right) \cdot i\right)\\
t_2 := 2 \cdot \left(z \cdot t - t\_1\right)\\
\mathbf{if}\;c \leq -1.58 \cdot 10^{-86}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;c \leq 10^{-108}:\\
\;\;\;\;2 \cdot \left(x \cdot y + z \cdot t\right)\\
\mathbf{elif}\;c \leq 7.6 \cdot 10^{+61}:\\
\;\;\;\;2 \cdot \left(x \cdot y - t\_1\right)\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if c < -1.58000000000000007e-86 or 7.5999999999999999e61 < c Initial program 83.7%
Taylor expanded in x around 0 86.7%
if -1.58000000000000007e-86 < c < 1.00000000000000004e-108Initial program 100.0%
Taylor expanded in c around 0 91.6%
if 1.00000000000000004e-108 < c < 7.5999999999999999e61Initial program 97.2%
Taylor expanded in z around 0 83.8%
Final simplification87.9%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* 2.0 (* x y))))
(if (<= (* x y) -1.6e+89)
t_1
(if (<= (* x y) -3.9e-39)
(* -2.0 (* a (* c i)))
(if (<= (* x y) 6.7e+16) (* 2.0 (* z t)) 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 * (x * y);
double tmp;
if ((x * y) <= -1.6e+89) {
tmp = t_1;
} else if ((x * y) <= -3.9e-39) {
tmp = -2.0 * (a * (c * i));
} else if ((x * y) <= 6.7e+16) {
tmp = 2.0 * (z * t);
} 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 * (x * y)
if ((x * y) <= (-1.6d+89)) then
tmp = t_1
else if ((x * y) <= (-3.9d-39)) then
tmp = (-2.0d0) * (a * (c * i))
else if ((x * y) <= 6.7d+16) then
tmp = 2.0d0 * (z * t)
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 * (x * y);
double tmp;
if ((x * y) <= -1.6e+89) {
tmp = t_1;
} else if ((x * y) <= -3.9e-39) {
tmp = -2.0 * (a * (c * i));
} else if ((x * y) <= 6.7e+16) {
tmp = 2.0 * (z * t);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = 2.0 * (x * y) tmp = 0 if (x * y) <= -1.6e+89: tmp = t_1 elif (x * y) <= -3.9e-39: tmp = -2.0 * (a * (c * i)) elif (x * y) <= 6.7e+16: tmp = 2.0 * (z * t) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(2.0 * Float64(x * y)) tmp = 0.0 if (Float64(x * y) <= -1.6e+89) tmp = t_1; elseif (Float64(x * y) <= -3.9e-39) tmp = Float64(-2.0 * Float64(a * Float64(c * i))); elseif (Float64(x * y) <= 6.7e+16) tmp = Float64(2.0 * Float64(z * t)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = 2.0 * (x * y); tmp = 0.0; if ((x * y) <= -1.6e+89) tmp = t_1; elseif ((x * y) <= -3.9e-39) tmp = -2.0 * (a * (c * i)); elseif ((x * y) <= 6.7e+16) tmp = 2.0 * (z * t); 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[(x * y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x * y), $MachinePrecision], -1.6e+89], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], -3.9e-39], N[(-2.0 * N[(a * N[(c * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 6.7e+16], N[(2.0 * N[(z * t), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := 2 \cdot \left(x \cdot y\right)\\
\mathbf{if}\;x \cdot y \leq -1.6 \cdot 10^{+89}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \cdot y \leq -3.9 \cdot 10^{-39}:\\
\;\;\;\;-2 \cdot \left(a \cdot \left(c \cdot i\right)\right)\\
\mathbf{elif}\;x \cdot y \leq 6.7 \cdot 10^{+16}:\\
\;\;\;\;2 \cdot \left(z \cdot t\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (*.f64 x y) < -1.59999999999999994e89 or 6.7e16 < (*.f64 x y) Initial program 90.1%
Taylor expanded in x around inf 58.7%
if -1.59999999999999994e89 < (*.f64 x y) < -3.9000000000000003e-39Initial program 89.2%
Taylor expanded in x around 0 73.7%
Taylor expanded in a around inf 39.3%
*-commutative39.3%
Simplified39.3%
if -3.9000000000000003e-39 < (*.f64 x y) < 6.7e16Initial program 92.2%
Taylor expanded in z around inf 44.2%
Final simplification49.5%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* 2.0 (* x y))))
(if (<= (* x y) -1.7e+70)
t_1
(if (<= (* x y) -4.2e-42)
(* c (* -2.0 (* a i)))
(if (<= (* x y) 1.15e+15) (* 2.0 (* z t)) 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 * (x * y);
double tmp;
if ((x * y) <= -1.7e+70) {
tmp = t_1;
} else if ((x * y) <= -4.2e-42) {
tmp = c * (-2.0 * (a * i));
} else if ((x * y) <= 1.15e+15) {
tmp = 2.0 * (z * t);
} 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 * (x * y)
if ((x * y) <= (-1.7d+70)) then
tmp = t_1
else if ((x * y) <= (-4.2d-42)) then
tmp = c * ((-2.0d0) * (a * i))
else if ((x * y) <= 1.15d+15) then
tmp = 2.0d0 * (z * t)
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 * (x * y);
double tmp;
if ((x * y) <= -1.7e+70) {
tmp = t_1;
} else if ((x * y) <= -4.2e-42) {
tmp = c * (-2.0 * (a * i));
} else if ((x * y) <= 1.15e+15) {
tmp = 2.0 * (z * t);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = 2.0 * (x * y) tmp = 0 if (x * y) <= -1.7e+70: tmp = t_1 elif (x * y) <= -4.2e-42: tmp = c * (-2.0 * (a * i)) elif (x * y) <= 1.15e+15: tmp = 2.0 * (z * t) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(2.0 * Float64(x * y)) tmp = 0.0 if (Float64(x * y) <= -1.7e+70) tmp = t_1; elseif (Float64(x * y) <= -4.2e-42) tmp = Float64(c * Float64(-2.0 * Float64(a * i))); elseif (Float64(x * y) <= 1.15e+15) tmp = Float64(2.0 * Float64(z * t)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = 2.0 * (x * y); tmp = 0.0; if ((x * y) <= -1.7e+70) tmp = t_1; elseif ((x * y) <= -4.2e-42) tmp = c * (-2.0 * (a * i)); elseif ((x * y) <= 1.15e+15) tmp = 2.0 * (z * t); 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[(x * y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x * y), $MachinePrecision], -1.7e+70], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], -4.2e-42], N[(c * N[(-2.0 * N[(a * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 1.15e+15], N[(2.0 * N[(z * t), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := 2 \cdot \left(x \cdot y\right)\\
\mathbf{if}\;x \cdot y \leq -1.7 \cdot 10^{+70}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \cdot y \leq -4.2 \cdot 10^{-42}:\\
\;\;\;\;c \cdot \left(-2 \cdot \left(a \cdot i\right)\right)\\
\mathbf{elif}\;x \cdot y \leq 1.15 \cdot 10^{+15}:\\
\;\;\;\;2 \cdot \left(z \cdot t\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (*.f64 x y) < -1.7e70 or 1.15e15 < (*.f64 x y) Initial program 90.8%
Taylor expanded in x around inf 57.2%
if -1.7e70 < (*.f64 x y) < -4.20000000000000013e-42Initial program 86.3%
Taylor expanded in x around 0 81.9%
Taylor expanded in t around 0 64.8%
Taylor expanded in c around 0 39.4%
*-commutative39.4%
associate-*r*39.3%
associate-*l*39.3%
*-commutative39.3%
associate-*r*39.3%
*-commutative39.3%
Simplified39.3%
if -4.20000000000000013e-42 < (*.f64 x y) < 1.15e15Initial program 92.2%
Taylor expanded in z around inf 44.2%
Final simplification49.5%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= c -3.5e-86) (not (<= c 5.4e+63))) (* 2.0 (- (* z t) (* 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 <= -3.5e-86) || !(c <= 5.4e+63)) {
tmp = 2.0 * ((z * t) - (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 <= (-3.5d-86)) .or. (.not. (c <= 5.4d+63))) then
tmp = 2.0d0 * ((z * t) - (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 <= -3.5e-86) || !(c <= 5.4e+63)) {
tmp = 2.0 * ((z * t) - (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 <= -3.5e-86) or not (c <= 5.4e+63): tmp = 2.0 * ((z * t) - (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 <= -3.5e-86) || !(c <= 5.4e+63)) 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(z * t))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if ((c <= -3.5e-86) || ~((c <= 5.4e+63))) tmp = 2.0 * ((z * t) - (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, -3.5e-86], N[Not[LessEqual[c, 5.4e+63]], $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[(2.0 * N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;c \leq -3.5 \cdot 10^{-86} \lor \neg \left(c \leq 5.4 \cdot 10^{+63}\right):\\
\;\;\;\;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 + z \cdot t\right)\\
\end{array}
\end{array}
if c < -3.50000000000000021e-86 or 5.40000000000000035e63 < c Initial program 83.6%
Taylor expanded in x around 0 87.1%
if -3.50000000000000021e-86 < c < 5.40000000000000035e63Initial program 99.1%
Taylor expanded in c around 0 83.2%
Final simplification85.2%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* c (* (+ a (* b c)) i))))
(if (<= c -5e+112)
(* t_1 -2.0)
(if (<= c 2.25e+66)
(* 2.0 (- (+ (* x y) (* z t)) (* i (* a c))))
(* 2.0 (- (* z t) t_1))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = c * ((a + (b * c)) * i);
double tmp;
if (c <= -5e+112) {
tmp = t_1 * -2.0;
} else if (c <= 2.25e+66) {
tmp = 2.0 * (((x * y) + (z * t)) - (i * (a * c)));
} else {
tmp = 2.0 * ((z * t) - 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 = c * ((a + (b * c)) * i)
if (c <= (-5d+112)) then
tmp = t_1 * (-2.0d0)
else if (c <= 2.25d+66) then
tmp = 2.0d0 * (((x * y) + (z * t)) - (i * (a * c)))
else
tmp = 2.0d0 * ((z * t) - 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 = c * ((a + (b * c)) * i);
double tmp;
if (c <= -5e+112) {
tmp = t_1 * -2.0;
} else if (c <= 2.25e+66) {
tmp = 2.0 * (((x * y) + (z * t)) - (i * (a * c)));
} else {
tmp = 2.0 * ((z * t) - t_1);
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = c * ((a + (b * c)) * i) tmp = 0 if c <= -5e+112: tmp = t_1 * -2.0 elif c <= 2.25e+66: tmp = 2.0 * (((x * y) + (z * t)) - (i * (a * c))) else: tmp = 2.0 * ((z * t) - t_1) return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(c * Float64(Float64(a + Float64(b * c)) * i)) tmp = 0.0 if (c <= -5e+112) tmp = Float64(t_1 * -2.0); elseif (c <= 2.25e+66) tmp = Float64(2.0 * Float64(Float64(Float64(x * y) + Float64(z * t)) - Float64(i * Float64(a * c)))); else tmp = Float64(2.0 * Float64(Float64(z * t) - t_1)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = c * ((a + (b * c)) * i); tmp = 0.0; if (c <= -5e+112) tmp = t_1 * -2.0; elseif (c <= 2.25e+66) tmp = 2.0 * (((x * y) + (z * t)) - (i * (a * c))); else tmp = 2.0 * ((z * t) - t_1); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(c * N[(N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[c, -5e+112], N[(t$95$1 * -2.0), $MachinePrecision], If[LessEqual[c, 2.25e+66], N[(2.0 * N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] - N[(i * N[(a * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[(z * t), $MachinePrecision] - t$95$1), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := c \cdot \left(\left(a + b \cdot c\right) \cdot i\right)\\
\mathbf{if}\;c \leq -5 \cdot 10^{+112}:\\
\;\;\;\;t\_1 \cdot -2\\
\mathbf{elif}\;c \leq 2.25 \cdot 10^{+66}:\\
\;\;\;\;2 \cdot \left(\left(x \cdot y + z \cdot t\right) - i \cdot \left(a \cdot c\right)\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(z \cdot t - t\_1\right)\\
\end{array}
\end{array}
if c < -5e112Initial program 82.2%
Taylor expanded in x around 0 94.6%
Taylor expanded in t around 0 94.8%
if -5e112 < c < 2.2499999999999999e66Initial program 98.1%
Taylor expanded in a around inf 91.6%
*-commutative91.6%
Simplified91.6%
if 2.2499999999999999e66 < c Initial program 76.7%
Taylor expanded in x around 0 92.7%
Final simplification92.4%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= c -2.2e+181) (and (not (<= c -1.15e+77)) (<= c 5e+168))) (* 2.0 (+ (* x y) (* z t))) (* -2.0 (* 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 <= -2.2e+181) || (!(c <= -1.15e+77) && (c <= 5e+168))) {
tmp = 2.0 * ((x * y) + (z * t));
} else {
tmp = -2.0 * (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 <= (-2.2d+181)) .or. (.not. (c <= (-1.15d+77))) .and. (c <= 5d+168)) then
tmp = 2.0d0 * ((x * y) + (z * t))
else
tmp = (-2.0d0) * (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 <= -2.2e+181) || (!(c <= -1.15e+77) && (c <= 5e+168))) {
tmp = 2.0 * ((x * y) + (z * t));
} else {
tmp = -2.0 * (a * (c * i));
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if (c <= -2.2e+181) or (not (c <= -1.15e+77) and (c <= 5e+168)): tmp = 2.0 * ((x * y) + (z * t)) else: tmp = -2.0 * (a * (c * i)) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if ((c <= -2.2e+181) || (!(c <= -1.15e+77) && (c <= 5e+168))) tmp = Float64(2.0 * Float64(Float64(x * y) + Float64(z * t))); else tmp = Float64(-2.0 * 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 <= -2.2e+181) || (~((c <= -1.15e+77)) && (c <= 5e+168))) tmp = 2.0 * ((x * y) + (z * t)); else tmp = -2.0 * (a * (c * i)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[c, -2.2e+181], And[N[Not[LessEqual[c, -1.15e+77]], $MachinePrecision], LessEqual[c, 5e+168]]], N[(2.0 * N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(-2.0 * N[(a * N[(c * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;c \leq -2.2 \cdot 10^{+181} \lor \neg \left(c \leq -1.15 \cdot 10^{+77}\right) \land c \leq 5 \cdot 10^{+168}:\\
\;\;\;\;2 \cdot \left(x \cdot y + z \cdot t\right)\\
\mathbf{else}:\\
\;\;\;\;-2 \cdot \left(a \cdot \left(c \cdot i\right)\right)\\
\end{array}
\end{array}
if c < -2.2000000000000001e181 or -1.14999999999999997e77 < c < 4.99999999999999967e168Initial program 93.8%
Taylor expanded in c around 0 68.4%
if -2.2000000000000001e181 < c < -1.14999999999999997e77 or 4.99999999999999967e168 < c Initial program 78.9%
Taylor expanded in x around 0 93.5%
Taylor expanded in a around inf 47.7%
*-commutative47.7%
Simplified47.7%
Final simplification64.3%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ a (* b c))))
(if (<= c -1.8e+74)
(* (* c (* t_1 i)) -2.0)
(if (<= c 8.4e+79)
(* 2.0 (+ (* x y) (* z t)))
(* 2.0 (* t_1 (* c (- 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 <= -1.8e+74) {
tmp = (c * (t_1 * i)) * -2.0;
} else if (c <= 8.4e+79) {
tmp = 2.0 * ((x * y) + (z * t));
} else {
tmp = 2.0 * (t_1 * (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 = a + (b * c)
if (c <= (-1.8d+74)) then
tmp = (c * (t_1 * i)) * (-2.0d0)
else if (c <= 8.4d+79) then
tmp = 2.0d0 * ((x * y) + (z * t))
else
tmp = 2.0d0 * (t_1 * (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 = a + (b * c);
double tmp;
if (c <= -1.8e+74) {
tmp = (c * (t_1 * i)) * -2.0;
} else if (c <= 8.4e+79) {
tmp = 2.0 * ((x * y) + (z * t));
} else {
tmp = 2.0 * (t_1 * (c * -i));
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = a + (b * c) tmp = 0 if c <= -1.8e+74: tmp = (c * (t_1 * i)) * -2.0 elif c <= 8.4e+79: tmp = 2.0 * ((x * y) + (z * t)) else: tmp = 2.0 * (t_1 * (c * -i)) return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(a + Float64(b * c)) tmp = 0.0 if (c <= -1.8e+74) tmp = Float64(Float64(c * Float64(t_1 * i)) * -2.0); elseif (c <= 8.4e+79) tmp = Float64(2.0 * Float64(Float64(x * y) + Float64(z * t))); else tmp = Float64(2.0 * Float64(t_1 * Float64(c * Float64(-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 <= -1.8e+74) tmp = (c * (t_1 * i)) * -2.0; elseif (c <= 8.4e+79) tmp = 2.0 * ((x * y) + (z * t)); else tmp = 2.0 * (t_1 * (c * -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[c, -1.8e+74], N[(N[(c * N[(t$95$1 * i), $MachinePrecision]), $MachinePrecision] * -2.0), $MachinePrecision], If[LessEqual[c, 8.4e+79], N[(2.0 * N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(t$95$1 * N[(c * (-i)), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a + b \cdot c\\
\mathbf{if}\;c \leq -1.8 \cdot 10^{+74}:\\
\;\;\;\;\left(c \cdot \left(t\_1 \cdot i\right)\right) \cdot -2\\
\mathbf{elif}\;c \leq 8.4 \cdot 10^{+79}:\\
\;\;\;\;2 \cdot \left(x \cdot y + z \cdot t\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(t\_1 \cdot \left(c \cdot \left(-i\right)\right)\right)\\
\end{array}
\end{array}
if c < -1.79999999999999994e74Initial program 81.7%
Taylor expanded in x around 0 92.7%
Taylor expanded in t around 0 90.6%
if -1.79999999999999994e74 < c < 8.40000000000000032e79Initial program 98.1%
Taylor expanded in c around 0 78.1%
if 8.40000000000000032e79 < c Initial program 77.3%
associate-*l*96.2%
Applied egg-rr96.2%
Taylor expanded in i around inf 79.2%
mul-1-neg79.2%
associate-*r*79.2%
distribute-rgt-neg-in79.2%
sub0-neg79.2%
associate--r+79.2%
neg-sub079.2%
Simplified79.2%
Final simplification80.4%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= c -7.2e+70) (not (<= c 3.7e+79))) (* (* c (* (+ a (* b c)) i)) -2.0) (* 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 <= -7.2e+70) || !(c <= 3.7e+79)) {
tmp = (c * ((a + (b * c)) * i)) * -2.0;
} 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 <= (-7.2d+70)) .or. (.not. (c <= 3.7d+79))) then
tmp = (c * ((a + (b * c)) * i)) * (-2.0d0)
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 <= -7.2e+70) || !(c <= 3.7e+79)) {
tmp = (c * ((a + (b * c)) * i)) * -2.0;
} else {
tmp = 2.0 * ((x * y) + (z * t));
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if (c <= -7.2e+70) or not (c <= 3.7e+79): tmp = (c * ((a + (b * c)) * i)) * -2.0 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 <= -7.2e+70) || !(c <= 3.7e+79)) tmp = Float64(Float64(c * Float64(Float64(a + Float64(b * c)) * i)) * -2.0); 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 <= -7.2e+70) || ~((c <= 3.7e+79))) tmp = (c * ((a + (b * c)) * i)) * -2.0; 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, -7.2e+70], N[Not[LessEqual[c, 3.7e+79]], $MachinePrecision]], N[(N[(c * N[(N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision] * -2.0), $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 -7.2 \cdot 10^{+70} \lor \neg \left(c \leq 3.7 \cdot 10^{+79}\right):\\
\;\;\;\;\left(c \cdot \left(\left(a + b \cdot c\right) \cdot i\right)\right) \cdot -2\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(x \cdot y + z \cdot t\right)\\
\end{array}
\end{array}
if c < -7.1999999999999999e70 or 3.70000000000000009e79 < c Initial program 79.2%
Taylor expanded in x around 0 92.5%
Taylor expanded in t around 0 84.1%
if -7.1999999999999999e70 < c < 3.70000000000000009e79Initial program 98.1%
Taylor expanded in c around 0 78.1%
Final simplification80.4%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= c -6.2e+116) (not (<= c 3.8e+103))) (* (* b -2.0) (* c (* 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+116) || !(c <= 3.8e+103)) {
tmp = (b * -2.0) * (c * (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+116)) .or. (.not. (c <= 3.8d+103))) then
tmp = (b * (-2.0d0)) * (c * (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+116) || !(c <= 3.8e+103)) {
tmp = (b * -2.0) * (c * (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+116) or not (c <= 3.8e+103): tmp = (b * -2.0) * (c * (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+116) || !(c <= 3.8e+103)) tmp = Float64(Float64(b * -2.0) * Float64(c * 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 <= -6.2e+116) || ~((c <= 3.8e+103))) tmp = (b * -2.0) * (c * (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+116], N[Not[LessEqual[c, 3.8e+103]], $MachinePrecision]], N[(N[(b * -2.0), $MachinePrecision] * N[(c * N[(c * 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^{+116} \lor \neg \left(c \leq 3.8 \cdot 10^{+103}\right):\\
\;\;\;\;\left(b \cdot -2\right) \cdot \left(c \cdot \left(c \cdot i\right)\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(x \cdot y + z \cdot t\right)\\
\end{array}
\end{array}
if c < -6.19999999999999992e116 or 3.7999999999999997e103 < c Initial program 80.1%
Taylor expanded in x around 0 92.8%
Taylor expanded in c around inf 59.9%
associate-*r*59.9%
unpow259.9%
associate-*l*62.9%
Simplified62.9%
if -6.19999999999999992e116 < c < 3.7999999999999997e103Initial program 96.5%
Taylor expanded in c around 0 76.5%
Final simplification71.9%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= (* x y) -3.8e+69) (not (<= (* x y) 3.1e+14))) (* 2.0 (* x y)) (* 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) <= -3.8e+69) || !((x * y) <= 3.1e+14)) {
tmp = 2.0 * (x * y);
} 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) <= (-3.8d+69)) .or. (.not. ((x * y) <= 3.1d+14))) then
tmp = 2.0d0 * (x * y)
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) <= -3.8e+69) || !((x * y) <= 3.1e+14)) {
tmp = 2.0 * (x * y);
} else {
tmp = 2.0 * (z * t);
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if ((x * y) <= -3.8e+69) or not ((x * y) <= 3.1e+14): tmp = 2.0 * (x * y) 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) <= -3.8e+69) || !(Float64(x * y) <= 3.1e+14)) tmp = Float64(2.0 * Float64(x * y)); 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) <= -3.8e+69) || ~(((x * y) <= 3.1e+14))) tmp = 2.0 * (x * y); 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], -3.8e+69], N[Not[LessEqual[N[(x * y), $MachinePrecision], 3.1e+14]], $MachinePrecision]], N[(2.0 * N[(x * y), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(z * t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \cdot y \leq -3.8 \cdot 10^{+69} \lor \neg \left(x \cdot y \leq 3.1 \cdot 10^{+14}\right):\\
\;\;\;\;2 \cdot \left(x \cdot y\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(z \cdot t\right)\\
\end{array}
\end{array}
if (*.f64 x y) < -3.80000000000000028e69 or 3.1e14 < (*.f64 x y) Initial program 90.9%
Taylor expanded in x around inf 56.8%
if -3.80000000000000028e69 < (*.f64 x y) < 3.1e14Initial program 91.0%
Taylor expanded in z around inf 40.0%
Final simplification47.5%
(FPCore (x y z t a b c i)
:precision binary64
(if (<= c -1.6e+115)
(* (* c i) (* c (* b -2.0)))
(if (<= c 6.5e+103)
(* 2.0 (+ (* x y) (* z t)))
(* (* b -2.0) (* c (* c i))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (c <= -1.6e+115) {
tmp = (c * i) * (c * (b * -2.0));
} else if (c <= 6.5e+103) {
tmp = 2.0 * ((x * y) + (z * t));
} else {
tmp = (b * -2.0) * (c * (c * i));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: tmp
if (c <= (-1.6d+115)) then
tmp = (c * i) * (c * (b * (-2.0d0)))
else if (c <= 6.5d+103) then
tmp = 2.0d0 * ((x * y) + (z * t))
else
tmp = (b * (-2.0d0)) * (c * (c * i))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (c <= -1.6e+115) {
tmp = (c * i) * (c * (b * -2.0));
} else if (c <= 6.5e+103) {
tmp = 2.0 * ((x * y) + (z * t));
} else {
tmp = (b * -2.0) * (c * (c * i));
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if c <= -1.6e+115: tmp = (c * i) * (c * (b * -2.0)) elif c <= 6.5e+103: tmp = 2.0 * ((x * y) + (z * t)) else: tmp = (b * -2.0) * (c * (c * i)) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (c <= -1.6e+115) tmp = Float64(Float64(c * i) * Float64(c * Float64(b * -2.0))); elseif (c <= 6.5e+103) tmp = Float64(2.0 * Float64(Float64(x * y) + Float64(z * t))); else tmp = Float64(Float64(b * -2.0) * Float64(c * Float64(c * i))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if (c <= -1.6e+115) tmp = (c * i) * (c * (b * -2.0)); elseif (c <= 6.5e+103) tmp = 2.0 * ((x * y) + (z * t)); else tmp = (b * -2.0) * (c * (c * i)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[c, -1.6e+115], N[(N[(c * i), $MachinePrecision] * N[(c * N[(b * -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[c, 6.5e+103], N[(2.0 * N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(b * -2.0), $MachinePrecision] * N[(c * N[(c * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;c \leq -1.6 \cdot 10^{+115}:\\
\;\;\;\;\left(c \cdot i\right) \cdot \left(c \cdot \left(b \cdot -2\right)\right)\\
\mathbf{elif}\;c \leq 6.5 \cdot 10^{+103}:\\
\;\;\;\;2 \cdot \left(x \cdot y + z \cdot t\right)\\
\mathbf{else}:\\
\;\;\;\;\left(b \cdot -2\right) \cdot \left(c \cdot \left(c \cdot i\right)\right)\\
\end{array}
\end{array}
if c < -1.6e115Initial program 82.2%
Taylor expanded in x around 0 94.6%
Taylor expanded in c around inf 67.2%
associate-*r*67.2%
unpow267.2%
associate-*l*69.6%
Simplified69.6%
associate-*r*81.6%
*-commutative81.6%
Applied egg-rr81.6%
if -1.6e115 < c < 6.50000000000000001e103Initial program 96.5%
Taylor expanded in c around 0 76.5%
if 6.50000000000000001e103 < c Initial program 78.5%
Taylor expanded in x around 0 91.5%
Taylor expanded in c around inf 54.2%
associate-*r*54.2%
unpow254.2%
associate-*l*57.6%
Simplified57.6%
Final simplification73.6%
(FPCore (x y z t a b c i) :precision binary64 (* 2.0 (* z t)))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return 2.0 * (z * t);
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
code = 2.0d0 * (z * t)
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return 2.0 * (z * t);
}
def code(x, y, z, t, a, b, c, i): return 2.0 * (z * t)
function code(x, y, z, t, a, b, c, i) return Float64(2.0 * Float64(z * t)) end
function tmp = code(x, y, z, t, a, b, c, i) tmp = 2.0 * (z * t); end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(2.0 * N[(z * t), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
2 \cdot \left(z \cdot t\right)
\end{array}
Initial program 90.9%
Taylor expanded in z around inf 29.9%
Final simplification29.9%
(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 2024097
(FPCore (x y z t a b c i)
:name "Diagrams.ThreeD.Shapes:frustum from diagrams-lib-1.3.0.3, A"
:precision binary64
:alt
(* 2.0 (- (+ (* x y) (* z t)) (* (+ a (* b c)) (* c i))))
(* 2.0 (- (+ (* x y) (* z t)) (* (* (+ a (* b c)) c) i))))