
(FPCore (x y z t a b c i) :precision binary64 (* 2.0 (- (+ (* x y) (* z t)) (* (* (+ a (* b c)) c) i))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return 2.0 * (((x * y) + (z * t)) - (((a + (b * c)) * c) * i));
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
code = 2.0d0 * (((x * y) + (z * t)) - (((a + (b * c)) * c) * i))
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return 2.0 * (((x * y) + (z * t)) - (((a + (b * c)) * c) * i));
}
def code(x, y, z, t, a, b, c, i): return 2.0 * (((x * y) + (z * t)) - (((a + (b * c)) * c) * i))
function code(x, y, z, t, a, b, c, i) return Float64(2.0 * Float64(Float64(Float64(x * y) + Float64(z * t)) - Float64(Float64(Float64(a + Float64(b * c)) * c) * i))) end
function tmp = code(x, y, z, t, a, b, c, i) tmp = 2.0 * (((x * y) + (z * t)) - (((a + (b * c)) * c) * i)); end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(2.0 * N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] - N[(N[(N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision] * c), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
2 \cdot \left(\left(x \cdot y + z \cdot t\right) - \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i\right)
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 13 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a b c i) :precision binary64 (* 2.0 (- (+ (* x y) (* z t)) (* (* (+ a (* b c)) c) i))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return 2.0 * (((x * y) + (z * t)) - (((a + (b * c)) * c) * i));
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
code = 2.0d0 * (((x * y) + (z * t)) - (((a + (b * c)) * c) * i))
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return 2.0 * (((x * y) + (z * t)) - (((a + (b * c)) * c) * i));
}
def code(x, y, z, t, a, b, c, i): return 2.0 * (((x * y) + (z * t)) - (((a + (b * c)) * c) * i))
function code(x, y, z, t, a, b, c, i) return Float64(2.0 * Float64(Float64(Float64(x * y) + Float64(z * t)) - Float64(Float64(Float64(a + Float64(b * c)) * c) * i))) end
function tmp = code(x, y, z, t, a, b, c, i) tmp = 2.0 * (((x * y) + (z * t)) - (((a + (b * c)) * c) * i)); end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(2.0 * N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] - N[(N[(N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision] * c), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
2 \cdot \left(\left(x \cdot y + z \cdot t\right) - \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i\right)
\end{array}
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ a (* b c))) (t_2 (+ (* x y) (* z t))))
(if (<= (- t_2 (* (* c t_1) i)) INFINITY)
(* 2.0 (- t_2 (* t_1 (* c i))))
(* (* i (pow c 2.0)) (* b -2.0)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = a + (b * c);
double t_2 = (x * y) + (z * t);
double tmp;
if ((t_2 - ((c * t_1) * i)) <= ((double) INFINITY)) {
tmp = 2.0 * (t_2 - (t_1 * (c * i)));
} else {
tmp = (i * pow(c, 2.0)) * (b * -2.0);
}
return tmp;
}
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = a + (b * c);
double t_2 = (x * y) + (z * t);
double tmp;
if ((t_2 - ((c * t_1) * i)) <= Double.POSITIVE_INFINITY) {
tmp = 2.0 * (t_2 - (t_1 * (c * i)));
} else {
tmp = (i * Math.pow(c, 2.0)) * (b * -2.0);
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = a + (b * c) t_2 = (x * y) + (z * t) tmp = 0 if (t_2 - ((c * t_1) * i)) <= math.inf: tmp = 2.0 * (t_2 - (t_1 * (c * i))) else: tmp = (i * math.pow(c, 2.0)) * (b * -2.0) return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(a + Float64(b * c)) t_2 = Float64(Float64(x * y) + Float64(z * t)) tmp = 0.0 if (Float64(t_2 - Float64(Float64(c * t_1) * i)) <= Inf) tmp = Float64(2.0 * Float64(t_2 - Float64(t_1 * Float64(c * i)))); else tmp = Float64(Float64(i * (c ^ 2.0)) * Float64(b * -2.0)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = a + (b * c); t_2 = (x * y) + (z * t); tmp = 0.0; if ((t_2 - ((c * t_1) * i)) <= Inf) tmp = 2.0 * (t_2 - (t_1 * (c * i))); else tmp = (i * (c ^ 2.0)) * (b * -2.0); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(t$95$2 - N[(N[(c * t$95$1), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision], Infinity], N[(2.0 * N[(t$95$2 - N[(t$95$1 * N[(c * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(i * N[Power[c, 2.0], $MachinePrecision]), $MachinePrecision] * N[(b * -2.0), $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}:\\
\;\;\;\;\left(i \cdot {c}^{2}\right) \cdot \left(b \cdot -2\right)\\
\end{array}
\end{array}
if (-.f64 (+.f64 (*.f64 x y) (*.f64 z t)) (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i)) < +inf.0Initial program 94.9%
fma-define94.9%
associate-*l*98.7%
Simplified98.7%
fma-define98.7%
+-commutative98.7%
Applied egg-rr98.7%
if +inf.0 < (-.f64 (+.f64 (*.f64 x y) (*.f64 z t)) (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i)) Initial program 0.0%
Taylor expanded in x around 0 42.9%
Taylor expanded in a around 0 43.7%
associate-*r*43.7%
*-commutative43.7%
associate-*r*36.6%
Simplified36.6%
Taylor expanded in t around 0 72.0%
associate-*r*72.0%
*-commutative72.0%
*-commutative72.0%
Simplified72.0%
Final simplification97.3%
(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) -3.8e+221)
t_3
(if (<= (* x y) -1.55e-98)
t_1
(if (<= (* x y) -1.05e-276)
t_2
(if (<= (* x y) 5.4e-127) t_1 (if (<= (* x y) 1.65e+72) 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) <= -3.8e+221) {
tmp = t_3;
} else if ((x * y) <= -1.55e-98) {
tmp = t_1;
} else if ((x * y) <= -1.05e-276) {
tmp = t_2;
} else if ((x * y) <= 5.4e-127) {
tmp = t_1;
} else if ((x * y) <= 1.65e+72) {
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) <= (-3.8d+221)) then
tmp = t_3
else if ((x * y) <= (-1.55d-98)) then
tmp = t_1
else if ((x * y) <= (-1.05d-276)) then
tmp = t_2
else if ((x * y) <= 5.4d-127) then
tmp = t_1
else if ((x * y) <= 1.65d+72) 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) <= -3.8e+221) {
tmp = t_3;
} else if ((x * y) <= -1.55e-98) {
tmp = t_1;
} else if ((x * y) <= -1.05e-276) {
tmp = t_2;
} else if ((x * y) <= 5.4e-127) {
tmp = t_1;
} else if ((x * y) <= 1.65e+72) {
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) <= -3.8e+221: tmp = t_3 elif (x * y) <= -1.55e-98: tmp = t_1 elif (x * y) <= -1.05e-276: tmp = t_2 elif (x * y) <= 5.4e-127: tmp = t_1 elif (x * y) <= 1.65e+72: 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(c * Float64(i * Float64(a * -2.0))) t_3 = Float64(Float64(x * y) * 2.0) tmp = 0.0 if (Float64(x * y) <= -3.8e+221) tmp = t_3; elseif (Float64(x * y) <= -1.55e-98) tmp = t_1; elseif (Float64(x * y) <= -1.05e-276) tmp = t_2; elseif (Float64(x * y) <= 5.4e-127) tmp = t_1; elseif (Float64(x * y) <= 1.65e+72) 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) <= -3.8e+221) tmp = t_3; elseif ((x * y) <= -1.55e-98) tmp = t_1; elseif ((x * y) <= -1.05e-276) tmp = t_2; elseif ((x * y) <= 5.4e-127) tmp = t_1; elseif ((x * y) <= 1.65e+72) 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[(c * N[(i * N[(a * -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(x * y), $MachinePrecision] * 2.0), $MachinePrecision]}, If[LessEqual[N[(x * y), $MachinePrecision], -3.8e+221], t$95$3, If[LessEqual[N[(x * y), $MachinePrecision], -1.55e-98], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], -1.05e-276], t$95$2, If[LessEqual[N[(x * y), $MachinePrecision], 5.4e-127], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], 1.65e+72], t$95$2, t$95$3]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := 2 \cdot \left(z \cdot t\right)\\
t_2 := c \cdot \left(i \cdot \left(a \cdot -2\right)\right)\\
t_3 := \left(x \cdot y\right) \cdot 2\\
\mathbf{if}\;x \cdot y \leq -3.8 \cdot 10^{+221}:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;x \cdot y \leq -1.55 \cdot 10^{-98}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \cdot y \leq -1.05 \cdot 10^{-276}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;x \cdot y \leq 5.4 \cdot 10^{-127}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \cdot y \leq 1.65 \cdot 10^{+72}:\\
\;\;\;\;t\_2\\
\mathbf{else}:\\
\;\;\;\;t\_3\\
\end{array}
\end{array}
if (*.f64 x y) < -3.80000000000000034e221 or 1.65e72 < (*.f64 x y) Initial program 79.5%
Taylor expanded in x around inf 62.0%
if -3.80000000000000034e221 < (*.f64 x y) < -1.55e-98 or -1.05e-276 < (*.f64 x y) < 5.3999999999999999e-127Initial program 95.1%
Taylor expanded in z around inf 43.5%
if -1.55e-98 < (*.f64 x y) < -1.05e-276 or 5.3999999999999999e-127 < (*.f64 x y) < 1.65e72Initial program 92.7%
Taylor expanded in a around inf 44.1%
mul-1-neg44.1%
*-commutative44.1%
distribute-rgt-neg-in44.1%
Simplified44.1%
Taylor expanded in c around 0 44.1%
associate-*r*44.1%
Simplified44.1%
Taylor expanded in a around 0 44.1%
*-commutative44.1%
*-commutative44.1%
associate-*r*44.1%
associate-*l*35.8%
Simplified35.8%
Final simplification46.6%
(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) -3.8e+221)
t_3
(if (<= (* x y) -2.05e-98)
t_1
(if (<= (* x y) -3.4e-279)
t_2
(if (<= (* x y) 1.5e-129) t_1 (if (<= (* x y) 3.5e+72) 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) <= -3.8e+221) {
tmp = t_3;
} else if ((x * y) <= -2.05e-98) {
tmp = t_1;
} else if ((x * y) <= -3.4e-279) {
tmp = t_2;
} else if ((x * y) <= 1.5e-129) {
tmp = t_1;
} else if ((x * y) <= 3.5e+72) {
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) <= (-3.8d+221)) then
tmp = t_3
else if ((x * y) <= (-2.05d-98)) then
tmp = t_1
else if ((x * y) <= (-3.4d-279)) then
tmp = t_2
else if ((x * y) <= 1.5d-129) then
tmp = t_1
else if ((x * y) <= 3.5d+72) 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) <= -3.8e+221) {
tmp = t_3;
} else if ((x * y) <= -2.05e-98) {
tmp = t_1;
} else if ((x * y) <= -3.4e-279) {
tmp = t_2;
} else if ((x * y) <= 1.5e-129) {
tmp = t_1;
} else if ((x * y) <= 3.5e+72) {
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) <= -3.8e+221: tmp = t_3 elif (x * y) <= -2.05e-98: tmp = t_1 elif (x * y) <= -3.4e-279: tmp = t_2 elif (x * y) <= 1.5e-129: tmp = t_1 elif (x * y) <= 3.5e+72: 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) <= -3.8e+221) tmp = t_3; elseif (Float64(x * y) <= -2.05e-98) tmp = t_1; elseif (Float64(x * y) <= -3.4e-279) tmp = t_2; elseif (Float64(x * y) <= 1.5e-129) tmp = t_1; elseif (Float64(x * y) <= 3.5e+72) 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) <= -3.8e+221) tmp = t_3; elseif ((x * y) <= -2.05e-98) tmp = t_1; elseif ((x * y) <= -3.4e-279) tmp = t_2; elseif ((x * y) <= 1.5e-129) tmp = t_1; elseif ((x * y) <= 3.5e+72) 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], -3.8e+221], t$95$3, If[LessEqual[N[(x * y), $MachinePrecision], -2.05e-98], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], -3.4e-279], t$95$2, If[LessEqual[N[(x * y), $MachinePrecision], 1.5e-129], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], 3.5e+72], 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 -3.8 \cdot 10^{+221}:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;x \cdot y \leq -2.05 \cdot 10^{-98}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \cdot y \leq -3.4 \cdot 10^{-279}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;x \cdot y \leq 1.5 \cdot 10^{-129}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \cdot y \leq 3.5 \cdot 10^{+72}:\\
\;\;\;\;t\_2\\
\mathbf{else}:\\
\;\;\;\;t\_3\\
\end{array}
\end{array}
if (*.f64 x y) < -3.80000000000000034e221 or 3.5000000000000001e72 < (*.f64 x y) Initial program 79.5%
Taylor expanded in x around inf 62.0%
if -3.80000000000000034e221 < (*.f64 x y) < -2.0499999999999999e-98 or -3.40000000000000015e-279 < (*.f64 x y) < 1.4999999999999999e-129Initial program 95.1%
Taylor expanded in z around inf 43.5%
if -2.0499999999999999e-98 < (*.f64 x y) < -3.40000000000000015e-279 or 1.4999999999999999e-129 < (*.f64 x y) < 3.5000000000000001e72Initial program 92.7%
Taylor expanded in a around inf 44.1%
mul-1-neg44.1%
*-commutative44.1%
distribute-rgt-neg-in44.1%
Simplified44.1%
Taylor expanded in c around 0 44.1%
associate-*r*44.1%
Simplified44.1%
Final simplification49.2%
(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 -1e+296)
(* 2.0 (- (* z t) t_2))
(if (<= t_3 1e+207)
(* (- (+ (* x y) (* z t)) (* t_3 i)) 2.0)
(* 2.0 (- (* x y) t_2))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = a + (b * c);
double t_2 = c * (t_1 * i);
double t_3 = c * t_1;
double tmp;
if (t_3 <= -1e+296) {
tmp = 2.0 * ((z * t) - t_2);
} else if (t_3 <= 1e+207) {
tmp = (((x * y) + (z * t)) - (t_3 * i)) * 2.0;
} else {
tmp = 2.0 * ((x * y) - t_2);
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: tmp
t_1 = a + (b * c)
t_2 = c * (t_1 * i)
t_3 = c * t_1
if (t_3 <= (-1d+296)) then
tmp = 2.0d0 * ((z * t) - t_2)
else if (t_3 <= 1d+207) then
tmp = (((x * y) + (z * t)) - (t_3 * i)) * 2.0d0
else
tmp = 2.0d0 * ((x * y) - t_2)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = a + (b * c);
double t_2 = c * (t_1 * i);
double t_3 = c * t_1;
double tmp;
if (t_3 <= -1e+296) {
tmp = 2.0 * ((z * t) - t_2);
} else if (t_3 <= 1e+207) {
tmp = (((x * y) + (z * t)) - (t_3 * i)) * 2.0;
} else {
tmp = 2.0 * ((x * y) - t_2);
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = a + (b * c) t_2 = c * (t_1 * i) t_3 = c * t_1 tmp = 0 if t_3 <= -1e+296: tmp = 2.0 * ((z * t) - t_2) elif t_3 <= 1e+207: tmp = (((x * y) + (z * t)) - (t_3 * i)) * 2.0 else: tmp = 2.0 * ((x * y) - t_2) return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(a + Float64(b * c)) t_2 = Float64(c * Float64(t_1 * i)) t_3 = Float64(c * t_1) tmp = 0.0 if (t_3 <= -1e+296) tmp = Float64(2.0 * Float64(Float64(z * t) - t_2)); elseif (t_3 <= 1e+207) tmp = Float64(Float64(Float64(Float64(x * y) + Float64(z * t)) - Float64(t_3 * i)) * 2.0); else tmp = Float64(2.0 * Float64(Float64(x * y) - t_2)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = a + (b * c); t_2 = c * (t_1 * i); t_3 = c * t_1; tmp = 0.0; if (t_3 <= -1e+296) tmp = 2.0 * ((z * t) - t_2); elseif (t_3 <= 1e+207) tmp = (((x * y) + (z * t)) - (t_3 * i)) * 2.0; else tmp = 2.0 * ((x * y) - t_2); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(c * N[(t$95$1 * i), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(c * t$95$1), $MachinePrecision]}, If[LessEqual[t$95$3, -1e+296], N[(2.0 * N[(N[(z * t), $MachinePrecision] - t$95$2), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$3, 1e+207], N[(N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] - N[(t$95$3 * i), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision], N[(2.0 * N[(N[(x * y), $MachinePrecision] - t$95$2), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a + b \cdot c\\
t_2 := c \cdot \left(t\_1 \cdot i\right)\\
t_3 := c \cdot t\_1\\
\mathbf{if}\;t\_3 \leq -1 \cdot 10^{+296}:\\
\;\;\;\;2 \cdot \left(z \cdot t - t\_2\right)\\
\mathbf{elif}\;t\_3 \leq 10^{+207}:\\
\;\;\;\;\left(\left(x \cdot y + z \cdot t\right) - t\_3 \cdot i\right) \cdot 2\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(x \cdot y - t\_2\right)\\
\end{array}
\end{array}
if (*.f64 (+.f64 a (*.f64 b c)) c) < -9.99999999999999981e295Initial program 71.9%
Taylor expanded in x around 0 93.5%
if -9.99999999999999981e295 < (*.f64 (+.f64 a (*.f64 b c)) c) < 1e207Initial program 98.0%
if 1e207 < (*.f64 (+.f64 a (*.f64 b c)) c) Initial program 79.2%
Taylor expanded in z around 0 94.0%
Final simplification96.4%
(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 * 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 = (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 \left(-i\right)\right)\right)\\
\end{array}
\end{array}
if (-.f64 (+.f64 (*.f64 x y) (*.f64 z t)) (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i)) < +inf.0Initial program 94.9%
fma-define94.9%
associate-*l*98.7%
Simplified98.7%
fma-define98.7%
+-commutative98.7%
Applied egg-rr98.7%
if +inf.0 < (-.f64 (+.f64 (*.f64 x y) (*.f64 z t)) (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i)) Initial program 0.0%
Taylor expanded in i around inf 71.5%
Final simplification97.3%
(FPCore (x y z t a b c i)
:precision binary64
(if (or (<= c -2.4e-52)
(not
(or (<= c -2.9e-112) (and (not (<= c -2.2e-198)) (<= c 5.9e-65)))))
(* 2.0 (- (* z t) (* c (* (+ a (* b c)) i))))
(* (+ (* x y) (* z t)) 2.0)))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((c <= -2.4e-52) || !((c <= -2.9e-112) || (!(c <= -2.2e-198) && (c <= 5.9e-65)))) {
tmp = 2.0 * ((z * t) - (c * ((a + (b * c)) * i)));
} else {
tmp = ((x * y) + (z * t)) * 2.0;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: tmp
if ((c <= (-2.4d-52)) .or. (.not. (c <= (-2.9d-112)) .or. (.not. (c <= (-2.2d-198))) .and. (c <= 5.9d-65))) then
tmp = 2.0d0 * ((z * t) - (c * ((a + (b * c)) * i)))
else
tmp = ((x * y) + (z * t)) * 2.0d0
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((c <= -2.4e-52) || !((c <= -2.9e-112) || (!(c <= -2.2e-198) && (c <= 5.9e-65)))) {
tmp = 2.0 * ((z * t) - (c * ((a + (b * c)) * i)));
} else {
tmp = ((x * y) + (z * t)) * 2.0;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if (c <= -2.4e-52) or not ((c <= -2.9e-112) or (not (c <= -2.2e-198) and (c <= 5.9e-65))): tmp = 2.0 * ((z * t) - (c * ((a + (b * c)) * i))) else: tmp = ((x * y) + (z * t)) * 2.0 return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if ((c <= -2.4e-52) || !((c <= -2.9e-112) || (!(c <= -2.2e-198) && (c <= 5.9e-65)))) tmp = Float64(2.0 * Float64(Float64(z * t) - Float64(c * Float64(Float64(a + Float64(b * c)) * i)))); else tmp = Float64(Float64(Float64(x * y) + Float64(z * t)) * 2.0); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if ((c <= -2.4e-52) || ~(((c <= -2.9e-112) || (~((c <= -2.2e-198)) && (c <= 5.9e-65))))) tmp = 2.0 * ((z * t) - (c * ((a + (b * c)) * i))); else tmp = ((x * y) + (z * t)) * 2.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[c, -2.4e-52], N[Not[Or[LessEqual[c, -2.9e-112], And[N[Not[LessEqual[c, -2.2e-198]], $MachinePrecision], LessEqual[c, 5.9e-65]]]], $MachinePrecision]], N[(2.0 * N[(N[(z * t), $MachinePrecision] - N[(c * N[(N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;c \leq -2.4 \cdot 10^{-52} \lor \neg \left(c \leq -2.9 \cdot 10^{-112} \lor \neg \left(c \leq -2.2 \cdot 10^{-198}\right) \land c \leq 5.9 \cdot 10^{-65}\right):\\
\;\;\;\;2 \cdot \left(z \cdot t - c \cdot \left(\left(a + b \cdot c\right) \cdot i\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(x \cdot y + z \cdot t\right) \cdot 2\\
\end{array}
\end{array}
if c < -2.4000000000000002e-52 or -2.89999999999999992e-112 < c < -2.2e-198 or 5.89999999999999978e-65 < c Initial program 85.5%
Taylor expanded in x around 0 84.1%
if -2.4000000000000002e-52 < c < -2.89999999999999992e-112 or -2.2e-198 < c < 5.89999999999999978e-65Initial program 98.7%
Taylor expanded in c around 0 85.5%
Final simplification84.5%
(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.45e+34)
t_2
(if (<= c 6.5e-121)
(* 2.0 (- (+ (* x y) (* z t)) (* i (* a c))))
(if (or (<= c 8.4e+82) (not (<= c 1.3e+134)))
(* 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.45e+34) {
tmp = t_2;
} else if (c <= 6.5e-121) {
tmp = 2.0 * (((x * y) + (z * t)) - (i * (a * c)));
} else if ((c <= 8.4e+82) || !(c <= 1.3e+134)) {
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.45d+34)) then
tmp = t_2
else if (c <= 6.5d-121) then
tmp = 2.0d0 * (((x * y) + (z * t)) - (i * (a * c)))
else if ((c <= 8.4d+82) .or. (.not. (c <= 1.3d+134))) 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.45e+34) {
tmp = t_2;
} else if (c <= 6.5e-121) {
tmp = 2.0 * (((x * y) + (z * t)) - (i * (a * c)));
} else if ((c <= 8.4e+82) || !(c <= 1.3e+134)) {
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.45e+34: tmp = t_2 elif c <= 6.5e-121: tmp = 2.0 * (((x * y) + (z * t)) - (i * (a * c))) elif (c <= 8.4e+82) or not (c <= 1.3e+134): 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.45e+34) tmp = t_2; elseif (c <= 6.5e-121) tmp = Float64(2.0 * Float64(Float64(Float64(x * y) + Float64(z * t)) - Float64(i * Float64(a * c)))); elseif ((c <= 8.4e+82) || !(c <= 1.3e+134)) 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.45e+34) tmp = t_2; elseif (c <= 6.5e-121) tmp = 2.0 * (((x * y) + (z * t)) - (i * (a * c))); elseif ((c <= 8.4e+82) || ~((c <= 1.3e+134))) 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.45e+34], t$95$2, If[LessEqual[c, 6.5e-121], N[(2.0 * N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] - N[(i * N[(a * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[c, 8.4e+82], N[Not[LessEqual[c, 1.3e+134]], $MachinePrecision]], 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.45 \cdot 10^{+34}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;c \leq 6.5 \cdot 10^{-121}:\\
\;\;\;\;2 \cdot \left(\left(x \cdot y + z \cdot t\right) - i \cdot \left(a \cdot c\right)\right)\\
\mathbf{elif}\;c \leq 8.4 \cdot 10^{+82} \lor \neg \left(c \leq 1.3 \cdot 10^{+134}\right):\\
\;\;\;\;2 \cdot \left(x \cdot y - t\_1\right)\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if c < -1.4500000000000001e34 or 8.4000000000000001e82 < c < 1.3000000000000001e134Initial program 79.8%
Taylor expanded in x around 0 91.2%
if -1.4500000000000001e34 < c < 6.5000000000000003e-121Initial program 99.9%
Taylor expanded in a around inf 95.7%
*-commutative95.7%
Simplified95.7%
if 6.5000000000000003e-121 < c < 8.4000000000000001e82 or 1.3000000000000001e134 < c Initial program 86.4%
Taylor expanded in z around 0 92.4%
Final simplification93.3%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* c (* (+ a (* b c)) i))))
(if (or (<= (* x y) -1.9e+139) (not (<= (* x y) 2.6e+58)))
(* 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) <= -1.9e+139) || !((x * y) <= 2.6e+58)) {
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) <= (-1.9d+139)) .or. (.not. ((x * y) <= 2.6d+58))) 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) <= -1.9e+139) || !((x * y) <= 2.6e+58)) {
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) <= -1.9e+139) or not ((x * y) <= 2.6e+58): 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) <= -1.9e+139) || !(Float64(x * y) <= 2.6e+58)) 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) <= -1.9e+139) || ~(((x * y) <= 2.6e+58))) 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], -1.9e+139], N[Not[LessEqual[N[(x * y), $MachinePrecision], 2.6e+58]], $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 -1.9 \cdot 10^{+139} \lor \neg \left(x \cdot y \leq 2.6 \cdot 10^{+58}\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) < -1.9e139 or 2.59999999999999988e58 < (*.f64 x y) Initial program 80.3%
Taylor expanded in z around 0 82.4%
if -1.9e139 < (*.f64 x y) < 2.59999999999999988e58Initial program 94.7%
Taylor expanded in x around 0 87.6%
Final simplification85.8%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= c -2.3e+34) (not (<= c 6.8e-66))) (* 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 <= -2.3e+34) || !(c <= 6.8e-66)) {
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 <= (-2.3d+34)) .or. (.not. (c <= 6.8d-66))) 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 <= -2.3e+34) || !(c <= 6.8e-66)) {
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 <= -2.3e+34) or not (c <= 6.8e-66): 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 <= -2.3e+34) || !(c <= 6.8e-66)) tmp = Float64(2.0 * Float64(c * Float64(Float64(a + Float64(b * c)) * Float64(-i)))); else tmp = Float64(Float64(Float64(x * y) + Float64(z * t)) * 2.0); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if ((c <= -2.3e+34) || ~((c <= 6.8e-66))) 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, -2.3e+34], N[Not[LessEqual[c, 6.8e-66]], $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 -2.3 \cdot 10^{+34} \lor \neg \left(c \leq 6.8 \cdot 10^{-66}\right):\\
\;\;\;\;2 \cdot \left(c \cdot \left(\left(a + b \cdot c\right) \cdot \left(-i\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(x \cdot y + z \cdot t\right) \cdot 2\\
\end{array}
\end{array}
if c < -2.2999999999999998e34 or 6.79999999999999994e-66 < c Initial program 82.8%
Taylor expanded in i around inf 80.1%
if -2.2999999999999998e34 < c < 6.79999999999999994e-66Initial program 99.0%
Taylor expanded in c around 0 77.6%
Final simplification79.0%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= a -8e+101) (not (<= a 4.9e-29))) (* 2.0 (- (* z t) (* c (* a 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 ((a <= -8e+101) || !(a <= 4.9e-29)) {
tmp = 2.0 * ((z * t) - (c * (a * 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 ((a <= (-8d+101)) .or. (.not. (a <= 4.9d-29))) then
tmp = 2.0d0 * ((z * t) - (c * (a * 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 ((a <= -8e+101) || !(a <= 4.9e-29)) {
tmp = 2.0 * ((z * t) - (c * (a * i)));
} else {
tmp = ((x * y) + (z * t)) * 2.0;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if (a <= -8e+101) or not (a <= 4.9e-29): tmp = 2.0 * ((z * t) - (c * (a * 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 ((a <= -8e+101) || !(a <= 4.9e-29)) tmp = Float64(2.0 * Float64(Float64(z * t) - Float64(c * Float64(a * 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 ((a <= -8e+101) || ~((a <= 4.9e-29))) tmp = 2.0 * ((z * t) - (c * (a * 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[a, -8e+101], N[Not[LessEqual[a, 4.9e-29]], $MachinePrecision]], N[(2.0 * N[(N[(z * t), $MachinePrecision] - N[(c * N[(a * 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}\;a \leq -8 \cdot 10^{+101} \lor \neg \left(a \leq 4.9 \cdot 10^{-29}\right):\\
\;\;\;\;2 \cdot \left(z \cdot t - c \cdot \left(a \cdot i\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(x \cdot y + z \cdot t\right) \cdot 2\\
\end{array}
\end{array}
if a < -7.9999999999999998e101 or 4.8999999999999998e-29 < a Initial program 85.3%
Taylor expanded in x around 0 82.9%
Taylor expanded in a around inf 65.7%
if -7.9999999999999998e101 < a < 4.8999999999999998e-29Initial program 93.2%
Taylor expanded in c around 0 55.1%
Final simplification59.8%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= (* x y) -3.6e+221) (not (<= (* x y) 1.1e+74))) (* (* 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) <= -3.6e+221) || !((x * y) <= 1.1e+74)) {
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) <= (-3.6d+221)) .or. (.not. ((x * y) <= 1.1d+74))) 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) <= -3.6e+221) || !((x * y) <= 1.1e+74)) {
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) <= -3.6e+221) or not ((x * y) <= 1.1e+74): 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) <= -3.6e+221) || !(Float64(x * y) <= 1.1e+74)) 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) <= -3.6e+221) || ~(((x * y) <= 1.1e+74))) 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], -3.6e+221], N[Not[LessEqual[N[(x * y), $MachinePrecision], 1.1e+74]], $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 -3.6 \cdot 10^{+221} \lor \neg \left(x \cdot y \leq 1.1 \cdot 10^{+74}\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) < -3.60000000000000009e221 or 1.1000000000000001e74 < (*.f64 x y) Initial program 79.5%
Taylor expanded in x around inf 62.0%
if -3.60000000000000009e221 < (*.f64 x y) < 1.1000000000000001e74Initial program 94.0%
Taylor expanded in z around inf 33.8%
Final simplification42.2%
(FPCore (x y z t a b c i)
:precision binary64
(if (<= a -1.35e+139)
(* (* c i) (* a -2.0))
(if (<= a 1.15e+138)
(* (+ (* x y) (* z t)) 2.0)
(* 2.0 (* i (* a (- c)))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (a <= -1.35e+139) {
tmp = (c * i) * (a * -2.0);
} else if (a <= 1.15e+138) {
tmp = ((x * y) + (z * t)) * 2.0;
} else {
tmp = 2.0 * (i * (a * -c));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: tmp
if (a <= (-1.35d+139)) then
tmp = (c * i) * (a * (-2.0d0))
else if (a <= 1.15d+138) then
tmp = ((x * y) + (z * t)) * 2.0d0
else
tmp = 2.0d0 * (i * (a * -c))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (a <= -1.35e+139) {
tmp = (c * i) * (a * -2.0);
} else if (a <= 1.15e+138) {
tmp = ((x * y) + (z * t)) * 2.0;
} else {
tmp = 2.0 * (i * (a * -c));
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if a <= -1.35e+139: tmp = (c * i) * (a * -2.0) elif a <= 1.15e+138: tmp = ((x * y) + (z * t)) * 2.0 else: tmp = 2.0 * (i * (a * -c)) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (a <= -1.35e+139) tmp = Float64(Float64(c * i) * Float64(a * -2.0)); elseif (a <= 1.15e+138) tmp = Float64(Float64(Float64(x * y) + Float64(z * t)) * 2.0); else tmp = Float64(2.0 * Float64(i * Float64(a * Float64(-c)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if (a <= -1.35e+139) tmp = (c * i) * (a * -2.0); elseif (a <= 1.15e+138) tmp = ((x * y) + (z * t)) * 2.0; else tmp = 2.0 * (i * (a * -c)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[a, -1.35e+139], N[(N[(c * i), $MachinePrecision] * N[(a * -2.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 1.15e+138], N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision], N[(2.0 * N[(i * N[(a * (-c)), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -1.35 \cdot 10^{+139}:\\
\;\;\;\;\left(c \cdot i\right) \cdot \left(a \cdot -2\right)\\
\mathbf{elif}\;a \leq 1.15 \cdot 10^{+138}:\\
\;\;\;\;\left(x \cdot y + z \cdot t\right) \cdot 2\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(i \cdot \left(a \cdot \left(-c\right)\right)\right)\\
\end{array}
\end{array}
if a < -1.3499999999999999e139Initial program 83.0%
Taylor expanded in a around inf 61.8%
mul-1-neg61.8%
*-commutative61.8%
distribute-rgt-neg-in61.8%
Simplified61.8%
Taylor expanded in c around 0 61.8%
associate-*r*61.8%
Simplified61.8%
if -1.3499999999999999e139 < a < 1.15000000000000004e138Initial program 91.3%
Taylor expanded in c around 0 53.1%
if 1.15000000000000004e138 < a Initial program 87.2%
fma-define87.2%
associate-*l*99.9%
Simplified99.9%
fma-define99.9%
+-commutative99.9%
Applied egg-rr99.9%
Taylor expanded in a around inf 65.2%
neg-mul-165.2%
associate-*r*68.4%
distribute-rgt-neg-in68.4%
*-commutative68.4%
*-commutative68.4%
Simplified68.4%
Final simplification56.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 89.7%
Taylor expanded in z around inf 27.1%
Final simplification27.1%
(FPCore (x y z t a b c i) :precision binary64 (* 2.0 (- (+ (* x y) (* z t)) (* (+ a (* b c)) (* c i)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return 2.0 * (((x * y) + (z * t)) - ((a + (b * c)) * (c * i)));
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
code = 2.0d0 * (((x * y) + (z * t)) - ((a + (b * c)) * (c * i)))
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return 2.0 * (((x * y) + (z * t)) - ((a + (b * c)) * (c * i)));
}
def code(x, y, z, t, a, b, c, i): return 2.0 * (((x * y) + (z * t)) - ((a + (b * c)) * (c * i)))
function code(x, y, z, t, a, b, c, i) return Float64(2.0 * Float64(Float64(Float64(x * y) + Float64(z * t)) - Float64(Float64(a + Float64(b * c)) * Float64(c * i)))) end
function tmp = code(x, y, z, t, a, b, c, i) tmp = 2.0 * (((x * y) + (z * t)) - ((a + (b * c)) * (c * i))); end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(2.0 * N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] - N[(N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision] * N[(c * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
2 \cdot \left(\left(x \cdot y + z \cdot t\right) - \left(a + b \cdot c\right) \cdot \left(c \cdot i\right)\right)
\end{array}
herbie shell --seed 2024041
(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))))