
(FPCore (x y z t a b c i) :precision binary64 (* 2.0 (- (+ (* x y) (* z t)) (* (* (+ a (* b c)) c) i))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return 2.0 * (((x * y) + (z * t)) - (((a + (b * c)) * c) * i));
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
code = 2.0d0 * (((x * y) + (z * t)) - (((a + (b * c)) * c) * i))
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return 2.0 * (((x * y) + (z * t)) - (((a + (b * c)) * c) * i));
}
def code(x, y, z, t, a, b, c, i): return 2.0 * (((x * y) + (z * t)) - (((a + (b * c)) * c) * i))
function code(x, y, z, t, a, b, c, i) return Float64(2.0 * Float64(Float64(Float64(x * y) + Float64(z * t)) - Float64(Float64(Float64(a + Float64(b * c)) * c) * i))) end
function tmp = code(x, y, z, t, a, b, c, i) tmp = 2.0 * (((x * y) + (z * t)) - (((a + (b * c)) * c) * i)); end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(2.0 * N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] - N[(N[(N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision] * c), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
2 \cdot \left(\left(x \cdot y + z \cdot t\right) - \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i\right)
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 13 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a b c i) :precision binary64 (* 2.0 (- (+ (* x y) (* z t)) (* (* (+ a (* b c)) c) i))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return 2.0 * (((x * y) + (z * t)) - (((a + (b * c)) * c) * i));
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
code = 2.0d0 * (((x * y) + (z * t)) - (((a + (b * c)) * c) * i))
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return 2.0 * (((x * y) + (z * t)) - (((a + (b * c)) * c) * i));
}
def code(x, y, z, t, a, b, c, i): return 2.0 * (((x * y) + (z * t)) - (((a + (b * c)) * c) * i))
function code(x, y, z, t, a, b, c, i) return Float64(2.0 * Float64(Float64(Float64(x * y) + Float64(z * t)) - Float64(Float64(Float64(a + Float64(b * c)) * c) * i))) end
function tmp = code(x, y, z, t, a, b, c, i) tmp = 2.0 * (((x * y) + (z * t)) - (((a + (b * c)) * c) * i)); end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(2.0 * N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] - N[(N[(N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision] * c), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
2 \cdot \left(\left(x \cdot y + z \cdot t\right) - \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i\right)
\end{array}
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ a (* b c))) (t_2 (+ (* x y) (* z t))))
(if (<= (- t_2 (* i (* c t_1))) INFINITY)
(* 2.0 (- t_2 (* t_1 (* c i))))
(* 2.0 (* (* b (* c i)) (- c))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = a + (b * c);
double t_2 = (x * y) + (z * t);
double tmp;
if ((t_2 - (i * (c * t_1))) <= ((double) INFINITY)) {
tmp = 2.0 * (t_2 - (t_1 * (c * i)));
} else {
tmp = 2.0 * ((b * (c * i)) * -c);
}
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 - (i * (c * t_1))) <= Double.POSITIVE_INFINITY) {
tmp = 2.0 * (t_2 - (t_1 * (c * i)));
} else {
tmp = 2.0 * ((b * (c * i)) * -c);
}
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 - (i * (c * t_1))) <= math.inf: tmp = 2.0 * (t_2 - (t_1 * (c * i))) else: tmp = 2.0 * ((b * (c * i)) * -c) 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(i * Float64(c * t_1))) <= Inf) tmp = Float64(2.0 * Float64(t_2 - Float64(t_1 * Float64(c * i)))); else tmp = Float64(2.0 * Float64(Float64(b * Float64(c * i)) * Float64(-c))); 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 - (i * (c * t_1))) <= Inf) tmp = 2.0 * (t_2 - (t_1 * (c * i))); else tmp = 2.0 * ((b * (c * i)) * -c); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(t$95$2 - N[(i * N[(c * t$95$1), $MachinePrecision]), $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[(N[(b * N[(c * i), $MachinePrecision]), $MachinePrecision] * (-c)), $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 - i \cdot \left(c \cdot t\_1\right) \leq \infty:\\
\;\;\;\;2 \cdot \left(t\_2 - t\_1 \cdot \left(c \cdot i\right)\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(\left(b \cdot \left(c \cdot i\right)\right) \cdot \left(-c\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.0%
fma-define95.0%
associate-*l*98.4%
Simplified98.4%
fma-define98.4%
+-commutative98.4%
Applied egg-rr98.4%
if +inf.0 < (-.f64 (+.f64 (*.f64 x y) (*.f64 z t)) (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i)) Initial program 0.0%
Taylor expanded in x around 0 37.5%
distribute-rgt-in37.5%
Applied egg-rr37.5%
Taylor expanded in t around 0 62.7%
Taylor expanded in a around 0 62.7%
Final simplification97.3%
(FPCore (x y z t a b c i) :precision binary64 (* 2.0 (- (fma 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 * (fma(x, y, (z * t)) - ((a + (b * c)) * (c * i)));
}
function code(x, y, z, t, a, b, c, i) return Float64(2.0 * Float64(fma(x, y, Float64(z * t)) - Float64(Float64(a + Float64(b * c)) * Float64(c * i)))) end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(2.0 * N[(N[(x * y + 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(\mathsf{fma}\left(x, y, z \cdot t\right) - \left(a + b \cdot c\right) \cdot \left(c \cdot i\right)\right)
\end{array}
Initial program 92.0%
fma-define92.8%
associate-*l*96.1%
Simplified96.1%
Final simplification96.1%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* 2.0 (* z t))) (t_2 (* 2.0 (* x y))))
(if (<= (* x y) -1.25e+191)
t_2
(if (<= (* x y) 2.4e-215)
t_1
(if (<= (* x y) 5.5e-8)
(* (* c i) (* a -2.0))
(if (<= (* x y) 3e+73) t_1 t_2))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = 2.0 * (z * t);
double t_2 = 2.0 * (x * y);
double tmp;
if ((x * y) <= -1.25e+191) {
tmp = t_2;
} else if ((x * y) <= 2.4e-215) {
tmp = t_1;
} else if ((x * y) <= 5.5e-8) {
tmp = (c * i) * (a * -2.0);
} else if ((x * y) <= 3e+73) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = 2.0d0 * (z * t)
t_2 = 2.0d0 * (x * y)
if ((x * y) <= (-1.25d+191)) then
tmp = t_2
else if ((x * y) <= 2.4d-215) then
tmp = t_1
else if ((x * y) <= 5.5d-8) then
tmp = (c * i) * (a * (-2.0d0))
else if ((x * y) <= 3d+73) then
tmp = t_1
else
tmp = t_2
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = 2.0 * (z * t);
double t_2 = 2.0 * (x * y);
double tmp;
if ((x * y) <= -1.25e+191) {
tmp = t_2;
} else if ((x * y) <= 2.4e-215) {
tmp = t_1;
} else if ((x * y) <= 5.5e-8) {
tmp = (c * i) * (a * -2.0);
} else if ((x * y) <= 3e+73) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = 2.0 * (z * t) t_2 = 2.0 * (x * y) tmp = 0 if (x * y) <= -1.25e+191: tmp = t_2 elif (x * y) <= 2.4e-215: tmp = t_1 elif (x * y) <= 5.5e-8: tmp = (c * i) * (a * -2.0) elif (x * y) <= 3e+73: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(2.0 * Float64(z * t)) t_2 = Float64(2.0 * Float64(x * y)) tmp = 0.0 if (Float64(x * y) <= -1.25e+191) tmp = t_2; elseif (Float64(x * y) <= 2.4e-215) tmp = t_1; elseif (Float64(x * y) <= 5.5e-8) tmp = Float64(Float64(c * i) * Float64(a * -2.0)); elseif (Float64(x * y) <= 3e+73) tmp = t_1; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = 2.0 * (z * t); t_2 = 2.0 * (x * y); tmp = 0.0; if ((x * y) <= -1.25e+191) tmp = t_2; elseif ((x * y) <= 2.4e-215) tmp = t_1; elseif ((x * y) <= 5.5e-8) tmp = (c * i) * (a * -2.0); elseif ((x * y) <= 3e+73) tmp = t_1; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(2.0 * N[(z * t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(2.0 * N[(x * y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x * y), $MachinePrecision], -1.25e+191], t$95$2, If[LessEqual[N[(x * y), $MachinePrecision], 2.4e-215], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], 5.5e-8], N[(N[(c * i), $MachinePrecision] * N[(a * -2.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 3e+73], t$95$1, t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := 2 \cdot \left(z \cdot t\right)\\
t_2 := 2 \cdot \left(x \cdot y\right)\\
\mathbf{if}\;x \cdot y \leq -1.25 \cdot 10^{+191}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;x \cdot y \leq 2.4 \cdot 10^{-215}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \cdot y \leq 5.5 \cdot 10^{-8}:\\
\;\;\;\;\left(c \cdot i\right) \cdot \left(a \cdot -2\right)\\
\mathbf{elif}\;x \cdot y \leq 3 \cdot 10^{+73}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if (*.f64 x y) < -1.25000000000000005e191 or 3.00000000000000011e73 < (*.f64 x y) Initial program 94.2%
Taylor expanded in x around inf 69.2%
if -1.25000000000000005e191 < (*.f64 x y) < 2.4000000000000001e-215 or 5.5000000000000003e-8 < (*.f64 x y) < 3.00000000000000011e73Initial program 89.7%
Taylor expanded in z around inf 44.4%
if 2.4000000000000001e-215 < (*.f64 x y) < 5.5000000000000003e-8Initial program 95.1%
Taylor expanded in a around inf 36.9%
mul-1-neg36.9%
*-commutative36.9%
associate-*l*27.4%
*-commutative27.4%
distribute-rgt-neg-in27.4%
*-commutative27.4%
distribute-rgt-neg-in27.4%
Simplified27.4%
Taylor expanded in c around 0 36.9%
associate-*r*36.9%
Simplified36.9%
Final simplification51.5%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ a (* b c))) (t_2 (* c t_1)))
(if (<= t_2 5e+266)
(* 2.0 (- (+ (* x y) (* z t)) (* i t_2)))
(* 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 = c * t_1;
double tmp;
if (t_2 <= 5e+266) {
tmp = 2.0 * (((x * y) + (z * t)) - (i * t_2));
} 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) :: t_2
real(8) :: tmp
t_1 = a + (b * c)
t_2 = c * t_1
if (t_2 <= 5d+266) then
tmp = 2.0d0 * (((x * y) + (z * t)) - (i * t_2))
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 t_2 = c * t_1;
double tmp;
if (t_2 <= 5e+266) {
tmp = 2.0 * (((x * y) + (z * t)) - (i * t_2));
} 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 = c * t_1 tmp = 0 if t_2 <= 5e+266: tmp = 2.0 * (((x * y) + (z * t)) - (i * t_2)) 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(c * t_1) tmp = 0.0 if (t_2 <= 5e+266) tmp = Float64(2.0 * Float64(Float64(Float64(x * y) + Float64(z * t)) - Float64(i * t_2))); else tmp = Float64(2.0 * Float64(c * Float64(t_1 * Float64(-i)))); 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; tmp = 0.0; if (t_2 <= 5e+266) tmp = 2.0 * (((x * y) + (z * t)) - (i * t_2)); 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[(c * t$95$1), $MachinePrecision]}, If[LessEqual[t$95$2, 5e+266], N[(2.0 * N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] - N[(i * t$95$2), $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 := c \cdot t\_1\\
\mathbf{if}\;t\_2 \leq 5 \cdot 10^{+266}:\\
\;\;\;\;2 \cdot \left(\left(x \cdot y + z \cdot t\right) - i \cdot t\_2\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(c \cdot \left(t\_1 \cdot \left(-i\right)\right)\right)\\
\end{array}
\end{array}
if (*.f64 (+.f64 a (*.f64 b c)) c) < 4.9999999999999999e266Initial program 95.5%
if 4.9999999999999999e266 < (*.f64 (+.f64 a (*.f64 b c)) c) Initial program 71.4%
Taylor expanded in i around inf 89.9%
Final simplification94.7%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* c (* (+ a (* b c)) i))))
(if (or (<= (* x y) -2e+97) (not (<= (* x y) 5e+73)))
(* 2.0 (- (* x y) t_1))
(* 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 (((x * y) <= -2e+97) || !((x * y) <= 5e+73)) {
tmp = 2.0 * ((x * y) - t_1);
} 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 (((x * y) <= (-2d+97)) .or. (.not. ((x * y) <= 5d+73))) then
tmp = 2.0d0 * ((x * y) - t_1)
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 (((x * y) <= -2e+97) || !((x * y) <= 5e+73)) {
tmp = 2.0 * ((x * y) - t_1);
} 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 ((x * y) <= -2e+97) or not ((x * y) <= 5e+73): tmp = 2.0 * ((x * y) - t_1) 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 ((Float64(x * y) <= -2e+97) || !(Float64(x * y) <= 5e+73)) tmp = Float64(2.0 * Float64(Float64(x * y) - t_1)); 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 (((x * y) <= -2e+97) || ~(((x * y) <= 5e+73))) tmp = 2.0 * ((x * y) - t_1); 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[Or[LessEqual[N[(x * y), $MachinePrecision], -2e+97], N[Not[LessEqual[N[(x * y), $MachinePrecision], 5e+73]], $MachinePrecision]], N[(2.0 * N[(N[(x * y), $MachinePrecision] - t$95$1), $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}\;x \cdot y \leq -2 \cdot 10^{+97} \lor \neg \left(x \cdot y \leq 5 \cdot 10^{+73}\right):\\
\;\;\;\;2 \cdot \left(x \cdot y - t\_1\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(z \cdot t - t\_1\right)\\
\end{array}
\end{array}
if (*.f64 x y) < -2.0000000000000001e97 or 4.99999999999999976e73 < (*.f64 x y) Initial program 94.0%
Taylor expanded in z around 0 86.2%
if -2.0000000000000001e97 < (*.f64 x y) < 4.99999999999999976e73Initial program 90.8%
Taylor expanded in x around 0 81.7%
Final simplification83.4%
(FPCore (x y z t a b c i)
:precision binary64
(if (<= (* x y) -5e+173)
(* 2.0 (* y (+ x (/ (* z t) y))))
(if (<= (* x y) 1e+178)
(* 2.0 (- (* z t) (* c (* (+ a (* b c)) i))))
(* 2.0 (* x (+ y (/ (* z t) x)))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((x * y) <= -5e+173) {
tmp = 2.0 * (y * (x + ((z * t) / y)));
} else if ((x * y) <= 1e+178) {
tmp = 2.0 * ((z * t) - (c * ((a + (b * c)) * i)));
} else {
tmp = 2.0 * (x * (y + ((z * t) / x)));
}
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) <= (-5d+173)) then
tmp = 2.0d0 * (y * (x + ((z * t) / y)))
else if ((x * y) <= 1d+178) then
tmp = 2.0d0 * ((z * t) - (c * ((a + (b * c)) * i)))
else
tmp = 2.0d0 * (x * (y + ((z * t) / x)))
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) <= -5e+173) {
tmp = 2.0 * (y * (x + ((z * t) / y)));
} else if ((x * y) <= 1e+178) {
tmp = 2.0 * ((z * t) - (c * ((a + (b * c)) * i)));
} else {
tmp = 2.0 * (x * (y + ((z * t) / x)));
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if (x * y) <= -5e+173: tmp = 2.0 * (y * (x + ((z * t) / y))) elif (x * y) <= 1e+178: tmp = 2.0 * ((z * t) - (c * ((a + (b * c)) * i))) else: tmp = 2.0 * (x * (y + ((z * t) / x))) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (Float64(x * y) <= -5e+173) tmp = Float64(2.0 * Float64(y * Float64(x + Float64(Float64(z * t) / y)))); elseif (Float64(x * y) <= 1e+178) tmp = Float64(2.0 * Float64(Float64(z * t) - Float64(c * Float64(Float64(a + Float64(b * c)) * i)))); else tmp = Float64(2.0 * Float64(x * Float64(y + Float64(Float64(z * t) / x)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if ((x * y) <= -5e+173) tmp = 2.0 * (y * (x + ((z * t) / y))); elseif ((x * y) <= 1e+178) tmp = 2.0 * ((z * t) - (c * ((a + (b * c)) * i))); else tmp = 2.0 * (x * (y + ((z * t) / x))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[N[(x * y), $MachinePrecision], -5e+173], N[(2.0 * N[(y * N[(x + N[(N[(z * t), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 1e+178], 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[(x * N[(y + N[(N[(z * t), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \cdot y \leq -5 \cdot 10^{+173}:\\
\;\;\;\;2 \cdot \left(y \cdot \left(x + \frac{z \cdot t}{y}\right)\right)\\
\mathbf{elif}\;x \cdot y \leq 10^{+178}:\\
\;\;\;\;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 \left(y + \frac{z \cdot t}{x}\right)\right)\\
\end{array}
\end{array}
if (*.f64 x y) < -5.00000000000000034e173Initial program 93.4%
Taylor expanded in c around 0 82.7%
Taylor expanded in y around inf 82.9%
if -5.00000000000000034e173 < (*.f64 x y) < 1.0000000000000001e178Initial program 91.5%
Taylor expanded in x around 0 80.4%
if 1.0000000000000001e178 < (*.f64 x y) Initial program 93.3%
Taylor expanded in c around 0 87.0%
Taylor expanded in x around inf 90.3%
Final simplification82.0%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* c (* (+ a (* b c)) i))))
(if (<= c -2e+16)
(* 2.0 (- (* z t) t_1))
(if (<= c 8.4e-63)
(* 2.0 (- (+ (* x y) (* z t)) (* a (* c i))))
(* 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 = c * ((a + (b * c)) * i);
double tmp;
if (c <= -2e+16) {
tmp = 2.0 * ((z * t) - t_1);
} else if (c <= 8.4e-63) {
tmp = 2.0 * (((x * y) + (z * t)) - (a * (c * i)));
} else {
tmp = 2.0 * ((x * y) - 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 <= (-2d+16)) then
tmp = 2.0d0 * ((z * t) - t_1)
else if (c <= 8.4d-63) then
tmp = 2.0d0 * (((x * y) + (z * t)) - (a * (c * i)))
else
tmp = 2.0d0 * ((x * y) - 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 <= -2e+16) {
tmp = 2.0 * ((z * t) - t_1);
} else if (c <= 8.4e-63) {
tmp = 2.0 * (((x * y) + (z * t)) - (a * (c * i)));
} else {
tmp = 2.0 * ((x * y) - 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 <= -2e+16: tmp = 2.0 * ((z * t) - t_1) elif c <= 8.4e-63: tmp = 2.0 * (((x * y) + (z * t)) - (a * (c * i))) else: tmp = 2.0 * ((x * y) - 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 <= -2e+16) tmp = Float64(2.0 * Float64(Float64(z * t) - t_1)); elseif (c <= 8.4e-63) tmp = Float64(2.0 * Float64(Float64(Float64(x * y) + Float64(z * t)) - Float64(a * Float64(c * i)))); else tmp = Float64(2.0 * Float64(Float64(x * y) - 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 <= -2e+16) tmp = 2.0 * ((z * t) - t_1); elseif (c <= 8.4e-63) tmp = 2.0 * (((x * y) + (z * t)) - (a * (c * i))); else tmp = 2.0 * ((x * y) - 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, -2e+16], N[(2.0 * N[(N[(z * t), $MachinePrecision] - t$95$1), $MachinePrecision]), $MachinePrecision], If[LessEqual[c, 8.4e-63], N[(2.0 * N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] - N[(a * N[(c * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[(x * y), $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 -2 \cdot 10^{+16}:\\
\;\;\;\;2 \cdot \left(z \cdot t - t\_1\right)\\
\mathbf{elif}\;c \leq 8.4 \cdot 10^{-63}:\\
\;\;\;\;2 \cdot \left(\left(x \cdot y + z \cdot t\right) - a \cdot \left(c \cdot i\right)\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(x \cdot y - t\_1\right)\\
\end{array}
\end{array}
if c < -2e16Initial program 83.1%
Taylor expanded in x around 0 84.8%
if -2e16 < c < 8.4e-63Initial program 98.5%
Taylor expanded in c around inf 70.1%
Taylor expanded in c around 0 92.7%
if 8.4e-63 < c Initial program 85.9%
Taylor expanded in z around 0 85.7%
Final simplification89.3%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* c (* (+ a (* b c)) i))))
(if (<= c -1.75e+16)
(* 2.0 (- (* z t) t_1))
(if (<= c 6.5e-63)
(* 2.0 (- (+ (* x y) (* z t)) (* i (* a c))))
(* 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 = c * ((a + (b * c)) * i);
double tmp;
if (c <= -1.75e+16) {
tmp = 2.0 * ((z * t) - t_1);
} else if (c <= 6.5e-63) {
tmp = 2.0 * (((x * y) + (z * t)) - (i * (a * c)));
} else {
tmp = 2.0 * ((x * y) - 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 <= (-1.75d+16)) then
tmp = 2.0d0 * ((z * t) - t_1)
else if (c <= 6.5d-63) then
tmp = 2.0d0 * (((x * y) + (z * t)) - (i * (a * c)))
else
tmp = 2.0d0 * ((x * y) - 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 <= -1.75e+16) {
tmp = 2.0 * ((z * t) - t_1);
} else if (c <= 6.5e-63) {
tmp = 2.0 * (((x * y) + (z * t)) - (i * (a * c)));
} else {
tmp = 2.0 * ((x * y) - 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 <= -1.75e+16: tmp = 2.0 * ((z * t) - t_1) elif c <= 6.5e-63: tmp = 2.0 * (((x * y) + (z * t)) - (i * (a * c))) else: tmp = 2.0 * ((x * y) - 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 <= -1.75e+16) tmp = Float64(2.0 * Float64(Float64(z * t) - t_1)); elseif (c <= 6.5e-63) tmp = Float64(2.0 * Float64(Float64(Float64(x * y) + Float64(z * t)) - Float64(i * Float64(a * c)))); else tmp = Float64(2.0 * Float64(Float64(x * y) - 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 <= -1.75e+16) tmp = 2.0 * ((z * t) - t_1); elseif (c <= 6.5e-63) tmp = 2.0 * (((x * y) + (z * t)) - (i * (a * c))); else tmp = 2.0 * ((x * y) - 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, -1.75e+16], N[(2.0 * N[(N[(z * t), $MachinePrecision] - t$95$1), $MachinePrecision]), $MachinePrecision], If[LessEqual[c, 6.5e-63], 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[(x * y), $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 -1.75 \cdot 10^{+16}:\\
\;\;\;\;2 \cdot \left(z \cdot t - t\_1\right)\\
\mathbf{elif}\;c \leq 6.5 \cdot 10^{-63}:\\
\;\;\;\;2 \cdot \left(\left(x \cdot y + z \cdot t\right) - i \cdot \left(a \cdot c\right)\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(x \cdot y - t\_1\right)\\
\end{array}
\end{array}
if c < -1.75e16Initial program 83.1%
Taylor expanded in x around 0 84.8%
if -1.75e16 < c < 6.4999999999999998e-63Initial program 98.5%
Taylor expanded in a around inf 93.4%
*-commutative93.4%
Simplified93.4%
if 6.4999999999999998e-63 < c Initial program 85.9%
Taylor expanded in z around 0 85.7%
Final simplification89.6%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= c -7.5e+41) (not (<= c 2.4e-54))) (* 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 <= -7.5e+41) || !(c <= 2.4e-54)) {
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 <= (-7.5d+41)) .or. (.not. (c <= 2.4d-54))) 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 <= -7.5e+41) || !(c <= 2.4e-54)) {
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 <= -7.5e+41) or not (c <= 2.4e-54): 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 <= -7.5e+41) || !(c <= 2.4e-54)) tmp = Float64(2.0 * Float64(c * Float64(Float64(a + Float64(b * c)) * Float64(-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 <= -7.5e+41) || ~((c <= 2.4e-54))) 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, -7.5e+41], N[Not[LessEqual[c, 2.4e-54]], $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 -7.5 \cdot 10^{+41} \lor \neg \left(c \leq 2.4 \cdot 10^{-54}\right):\\
\;\;\;\;2 \cdot \left(c \cdot \left(\left(a + b \cdot c\right) \cdot \left(-i\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(x \cdot y + z \cdot t\right)\\
\end{array}
\end{array}
if c < -7.50000000000000072e41 or 2.40000000000000013e-54 < c Initial program 84.8%
Taylor expanded in i around inf 77.0%
if -7.50000000000000072e41 < c < 2.40000000000000013e-54Initial program 97.9%
Taylor expanded in c around 0 77.7%
Final simplification77.4%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= c -4e+65) (not (<= c 1.8e+36))) (* 2.0 (* (* b (* c i)) (- c))) (* 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 <= -4e+65) || !(c <= 1.8e+36)) {
tmp = 2.0 * ((b * (c * i)) * -c);
} 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 <= (-4d+65)) .or. (.not. (c <= 1.8d+36))) then
tmp = 2.0d0 * ((b * (c * i)) * -c)
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 <= -4e+65) || !(c <= 1.8e+36)) {
tmp = 2.0 * ((b * (c * i)) * -c);
} else {
tmp = 2.0 * ((x * y) + (z * t));
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if (c <= -4e+65) or not (c <= 1.8e+36): tmp = 2.0 * ((b * (c * i)) * -c) 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 <= -4e+65) || !(c <= 1.8e+36)) tmp = Float64(2.0 * Float64(Float64(b * Float64(c * i)) * Float64(-c))); 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 <= -4e+65) || ~((c <= 1.8e+36))) tmp = 2.0 * ((b * (c * i)) * -c); 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, -4e+65], N[Not[LessEqual[c, 1.8e+36]], $MachinePrecision]], N[(2.0 * N[(N[(b * N[(c * i), $MachinePrecision]), $MachinePrecision] * (-c)), $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 -4 \cdot 10^{+65} \lor \neg \left(c \leq 1.8 \cdot 10^{+36}\right):\\
\;\;\;\;2 \cdot \left(\left(b \cdot \left(c \cdot i\right)\right) \cdot \left(-c\right)\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(x \cdot y + z \cdot t\right)\\
\end{array}
\end{array}
if c < -4e65 or 1.7999999999999999e36 < c Initial program 82.7%
Taylor expanded in x around 0 84.7%
distribute-rgt-in80.5%
Applied egg-rr80.5%
Taylor expanded in t around 0 74.2%
Taylor expanded in a around 0 67.3%
if -4e65 < c < 1.7999999999999999e36Initial program 97.6%
Taylor expanded in c around 0 73.9%
Final simplification71.5%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= (* x y) -6.5e+199) (not (<= (* x y) 2.3e+74))) (* 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) <= -6.5e+199) || !((x * y) <= 2.3e+74)) {
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) <= (-6.5d+199)) .or. (.not. ((x * y) <= 2.3d+74))) 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) <= -6.5e+199) || !((x * y) <= 2.3e+74)) {
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) <= -6.5e+199) or not ((x * y) <= 2.3e+74): 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) <= -6.5e+199) || !(Float64(x * y) <= 2.3e+74)) 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) <= -6.5e+199) || ~(((x * y) <= 2.3e+74))) 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], -6.5e+199], N[Not[LessEqual[N[(x * y), $MachinePrecision], 2.3e+74]], $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 -6.5 \cdot 10^{+199} \lor \neg \left(x \cdot y \leq 2.3 \cdot 10^{+74}\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) < -6.5000000000000003e199 or 2.2999999999999999e74 < (*.f64 x y) Initial program 94.2%
Taylor expanded in x around inf 69.2%
if -6.5000000000000003e199 < (*.f64 x y) < 2.2999999999999999e74Initial program 91.0%
Taylor expanded in z around inf 40.1%
Final simplification49.8%
(FPCore (x y z t a b c i) :precision binary64 (if (<= c -6.5e+47) (* (* c i) (* a -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 <= -6.5e+47) {
tmp = (c * i) * (a * -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 <= (-6.5d+47)) then
tmp = (c * i) * (a * (-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 <= -6.5e+47) {
tmp = (c * i) * (a * -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 <= -6.5e+47: tmp = (c * i) * (a * -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 <= -6.5e+47) tmp = Float64(Float64(c * i) * Float64(a * -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 <= -6.5e+47) tmp = (c * i) * (a * -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[LessEqual[c, -6.5e+47], N[(N[(c * i), $MachinePrecision] * N[(a * -2.0), $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.5 \cdot 10^{+47}:\\
\;\;\;\;\left(c \cdot i\right) \cdot \left(a \cdot -2\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(x \cdot y + z \cdot t\right)\\
\end{array}
\end{array}
if c < -6.49999999999999988e47Initial program 82.6%
Taylor expanded in a around inf 32.6%
mul-1-neg32.6%
*-commutative32.6%
associate-*l*28.3%
*-commutative28.3%
distribute-rgt-neg-in28.3%
*-commutative28.3%
distribute-rgt-neg-in28.3%
Simplified28.3%
Taylor expanded in c around 0 32.6%
associate-*r*32.6%
Simplified32.6%
if -6.49999999999999988e47 < c Initial program 94.0%
Taylor expanded in c around 0 65.5%
Final simplification59.8%
(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 92.0%
Taylor expanded in z around inf 31.4%
Final simplification31.4%
(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 2024050
(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))))