
(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 15 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))))
(if (<= (- (+ (* x y) (* z t)) (* (* c t_1) i)) INFINITY)
(* 2.0 (- (fma x y (* z t)) (* t_1 (* c i))))
(* t (* 2.0 (+ z (* x (/ y t))))))))
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 ((((x * y) + (z * t)) - ((c * t_1) * i)) <= ((double) INFINITY)) {
tmp = 2.0 * (fma(x, y, (z * t)) - (t_1 * (c * i)));
} else {
tmp = t * (2.0 * (z + (x * (y / t))));
}
return tmp;
}
function code(x, y, z, t, a, b, c, i) t_1 = Float64(a + Float64(b * c)) tmp = 0.0 if (Float64(Float64(Float64(x * y) + Float64(z * t)) - Float64(Float64(c * t_1) * i)) <= Inf) tmp = Float64(2.0 * Float64(fma(x, y, Float64(z * t)) - Float64(t_1 * Float64(c * i)))); else tmp = Float64(t * Float64(2.0 * Float64(z + Float64(x * Float64(y / t))))); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] - N[(N[(c * t$95$1), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision], Infinity], N[(2.0 * N[(N[(x * y + N[(z * t), $MachinePrecision]), $MachinePrecision] - N[(t$95$1 * N[(c * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t * N[(2.0 * N[(z + N[(x * N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a + b \cdot c\\
\mathbf{if}\;\left(x \cdot y + z \cdot t\right) - \left(c \cdot t\_1\right) \cdot i \leq \infty:\\
\;\;\;\;2 \cdot \left(\mathsf{fma}\left(x, y, z \cdot t\right) - t\_1 \cdot \left(c \cdot i\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t \cdot \left(2 \cdot \left(z + x \cdot \frac{y}{t}\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 93.5%
fma-define93.5%
associate-*l*98.8%
Simplified98.8%
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 c around 0 66.7%
Taylor expanded in t around inf 77.8%
distribute-lft-out77.8%
associate-/l*77.8%
Simplified77.8%
Final simplification98.1%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* (* c i) (* a -2.0)))
(t_2 (* 2.0 (* z t)))
(t_3 (* (* x y) 2.0)))
(if (<= (* x y) -1.55e+52)
t_3
(if (<= (* x y) -4.7e-11)
t_1
(if (<= (* x y) -1.85e-65)
t_2
(if (<= (* x y) -6.4e-242)
t_1
(if (<= (* x y) 4.8e-77)
t_2
(if (<= (* x y) 2.5e+37) t_1 t_3))))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = (c * i) * (a * -2.0);
double t_2 = 2.0 * (z * t);
double t_3 = (x * y) * 2.0;
double tmp;
if ((x * y) <= -1.55e+52) {
tmp = t_3;
} else if ((x * y) <= -4.7e-11) {
tmp = t_1;
} else if ((x * y) <= -1.85e-65) {
tmp = t_2;
} else if ((x * y) <= -6.4e-242) {
tmp = t_1;
} else if ((x * y) <= 4.8e-77) {
tmp = t_2;
} else if ((x * y) <= 2.5e+37) {
tmp = t_1;
} 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 = (c * i) * (a * (-2.0d0))
t_2 = 2.0d0 * (z * t)
t_3 = (x * y) * 2.0d0
if ((x * y) <= (-1.55d+52)) then
tmp = t_3
else if ((x * y) <= (-4.7d-11)) then
tmp = t_1
else if ((x * y) <= (-1.85d-65)) then
tmp = t_2
else if ((x * y) <= (-6.4d-242)) then
tmp = t_1
else if ((x * y) <= 4.8d-77) then
tmp = t_2
else if ((x * y) <= 2.5d+37) then
tmp = t_1
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 = (c * i) * (a * -2.0);
double t_2 = 2.0 * (z * t);
double t_3 = (x * y) * 2.0;
double tmp;
if ((x * y) <= -1.55e+52) {
tmp = t_3;
} else if ((x * y) <= -4.7e-11) {
tmp = t_1;
} else if ((x * y) <= -1.85e-65) {
tmp = t_2;
} else if ((x * y) <= -6.4e-242) {
tmp = t_1;
} else if ((x * y) <= 4.8e-77) {
tmp = t_2;
} else if ((x * y) <= 2.5e+37) {
tmp = t_1;
} else {
tmp = t_3;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = (c * i) * (a * -2.0) t_2 = 2.0 * (z * t) t_3 = (x * y) * 2.0 tmp = 0 if (x * y) <= -1.55e+52: tmp = t_3 elif (x * y) <= -4.7e-11: tmp = t_1 elif (x * y) <= -1.85e-65: tmp = t_2 elif (x * y) <= -6.4e-242: tmp = t_1 elif (x * y) <= 4.8e-77: tmp = t_2 elif (x * y) <= 2.5e+37: tmp = t_1 else: tmp = t_3 return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(Float64(c * i) * Float64(a * -2.0)) t_2 = Float64(2.0 * Float64(z * t)) t_3 = Float64(Float64(x * y) * 2.0) tmp = 0.0 if (Float64(x * y) <= -1.55e+52) tmp = t_3; elseif (Float64(x * y) <= -4.7e-11) tmp = t_1; elseif (Float64(x * y) <= -1.85e-65) tmp = t_2; elseif (Float64(x * y) <= -6.4e-242) tmp = t_1; elseif (Float64(x * y) <= 4.8e-77) tmp = t_2; elseif (Float64(x * y) <= 2.5e+37) tmp = t_1; else tmp = t_3; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = (c * i) * (a * -2.0); t_2 = 2.0 * (z * t); t_3 = (x * y) * 2.0; tmp = 0.0; if ((x * y) <= -1.55e+52) tmp = t_3; elseif ((x * y) <= -4.7e-11) tmp = t_1; elseif ((x * y) <= -1.85e-65) tmp = t_2; elseif ((x * y) <= -6.4e-242) tmp = t_1; elseif ((x * y) <= 4.8e-77) tmp = t_2; elseif ((x * y) <= 2.5e+37) tmp = t_1; else tmp = t_3; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(c * i), $MachinePrecision] * N[(a * -2.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(2.0 * N[(z * t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(x * y), $MachinePrecision] * 2.0), $MachinePrecision]}, If[LessEqual[N[(x * y), $MachinePrecision], -1.55e+52], t$95$3, If[LessEqual[N[(x * y), $MachinePrecision], -4.7e-11], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], -1.85e-65], t$95$2, If[LessEqual[N[(x * y), $MachinePrecision], -6.4e-242], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], 4.8e-77], t$95$2, If[LessEqual[N[(x * y), $MachinePrecision], 2.5e+37], t$95$1, t$95$3]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(c \cdot i\right) \cdot \left(a \cdot -2\right)\\
t_2 := 2 \cdot \left(z \cdot t\right)\\
t_3 := \left(x \cdot y\right) \cdot 2\\
\mathbf{if}\;x \cdot y \leq -1.55 \cdot 10^{+52}:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;x \cdot y \leq -4.7 \cdot 10^{-11}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \cdot y \leq -1.85 \cdot 10^{-65}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;x \cdot y \leq -6.4 \cdot 10^{-242}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \cdot y \leq 4.8 \cdot 10^{-77}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;x \cdot y \leq 2.5 \cdot 10^{+37}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_3\\
\end{array}
\end{array}
if (*.f64 x y) < -1.55e52 or 2.49999999999999994e37 < (*.f64 x y) Initial program 90.1%
Taylor expanded in x around inf 60.1%
if -1.55e52 < (*.f64 x y) < -4.69999999999999993e-11 or -1.85e-65 < (*.f64 x y) < -6.39999999999999997e-242 or 4.7999999999999998e-77 < (*.f64 x y) < 2.49999999999999994e37Initial program 87.5%
Taylor expanded in a around inf 43.8%
mul-1-neg43.8%
*-commutative43.8%
associate-*l*37.4%
*-commutative37.4%
distribute-rgt-neg-in37.4%
*-commutative37.4%
distribute-rgt-neg-in37.4%
Simplified37.4%
Taylor expanded in c around 0 43.8%
associate-*r*43.8%
Simplified43.8%
if -4.69999999999999993e-11 < (*.f64 x y) < -1.85e-65 or -6.39999999999999997e-242 < (*.f64 x y) < 4.7999999999999998e-77Initial program 91.9%
Taylor expanded in z around inf 48.7%
Final simplification51.9%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* (* c i) (* a -2.0)))
(t_2 (* 2.0 (* z t)))
(t_3 (* (* x y) 2.0)))
(if (<= (* x y) -1.05e+49)
t_3
(if (<= (* x y) -3.4e-9)
t_1
(if (<= (* x y) -3.2e-67)
t_2
(if (<= (* x y) -5.8e-242)
(* i (* a (* c -2.0)))
(if (<= (* x y) 8.2e-81)
t_2
(if (<= (* x y) 1.7e+37) t_1 t_3))))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = (c * i) * (a * -2.0);
double t_2 = 2.0 * (z * t);
double t_3 = (x * y) * 2.0;
double tmp;
if ((x * y) <= -1.05e+49) {
tmp = t_3;
} else if ((x * y) <= -3.4e-9) {
tmp = t_1;
} else if ((x * y) <= -3.2e-67) {
tmp = t_2;
} else if ((x * y) <= -5.8e-242) {
tmp = i * (a * (c * -2.0));
} else if ((x * y) <= 8.2e-81) {
tmp = t_2;
} else if ((x * y) <= 1.7e+37) {
tmp = t_1;
} 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 = (c * i) * (a * (-2.0d0))
t_2 = 2.0d0 * (z * t)
t_3 = (x * y) * 2.0d0
if ((x * y) <= (-1.05d+49)) then
tmp = t_3
else if ((x * y) <= (-3.4d-9)) then
tmp = t_1
else if ((x * y) <= (-3.2d-67)) then
tmp = t_2
else if ((x * y) <= (-5.8d-242)) then
tmp = i * (a * (c * (-2.0d0)))
else if ((x * y) <= 8.2d-81) then
tmp = t_2
else if ((x * y) <= 1.7d+37) then
tmp = t_1
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 = (c * i) * (a * -2.0);
double t_2 = 2.0 * (z * t);
double t_3 = (x * y) * 2.0;
double tmp;
if ((x * y) <= -1.05e+49) {
tmp = t_3;
} else if ((x * y) <= -3.4e-9) {
tmp = t_1;
} else if ((x * y) <= -3.2e-67) {
tmp = t_2;
} else if ((x * y) <= -5.8e-242) {
tmp = i * (a * (c * -2.0));
} else if ((x * y) <= 8.2e-81) {
tmp = t_2;
} else if ((x * y) <= 1.7e+37) {
tmp = t_1;
} else {
tmp = t_3;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = (c * i) * (a * -2.0) t_2 = 2.0 * (z * t) t_3 = (x * y) * 2.0 tmp = 0 if (x * y) <= -1.05e+49: tmp = t_3 elif (x * y) <= -3.4e-9: tmp = t_1 elif (x * y) <= -3.2e-67: tmp = t_2 elif (x * y) <= -5.8e-242: tmp = i * (a * (c * -2.0)) elif (x * y) <= 8.2e-81: tmp = t_2 elif (x * y) <= 1.7e+37: tmp = t_1 else: tmp = t_3 return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(Float64(c * i) * Float64(a * -2.0)) t_2 = Float64(2.0 * Float64(z * t)) t_3 = Float64(Float64(x * y) * 2.0) tmp = 0.0 if (Float64(x * y) <= -1.05e+49) tmp = t_3; elseif (Float64(x * y) <= -3.4e-9) tmp = t_1; elseif (Float64(x * y) <= -3.2e-67) tmp = t_2; elseif (Float64(x * y) <= -5.8e-242) tmp = Float64(i * Float64(a * Float64(c * -2.0))); elseif (Float64(x * y) <= 8.2e-81) tmp = t_2; elseif (Float64(x * y) <= 1.7e+37) tmp = t_1; else tmp = t_3; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = (c * i) * (a * -2.0); t_2 = 2.0 * (z * t); t_3 = (x * y) * 2.0; tmp = 0.0; if ((x * y) <= -1.05e+49) tmp = t_3; elseif ((x * y) <= -3.4e-9) tmp = t_1; elseif ((x * y) <= -3.2e-67) tmp = t_2; elseif ((x * y) <= -5.8e-242) tmp = i * (a * (c * -2.0)); elseif ((x * y) <= 8.2e-81) tmp = t_2; elseif ((x * y) <= 1.7e+37) tmp = t_1; else tmp = t_3; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(c * i), $MachinePrecision] * N[(a * -2.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(2.0 * N[(z * t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(x * y), $MachinePrecision] * 2.0), $MachinePrecision]}, If[LessEqual[N[(x * y), $MachinePrecision], -1.05e+49], t$95$3, If[LessEqual[N[(x * y), $MachinePrecision], -3.4e-9], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], -3.2e-67], t$95$2, If[LessEqual[N[(x * y), $MachinePrecision], -5.8e-242], N[(i * N[(a * N[(c * -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 8.2e-81], t$95$2, If[LessEqual[N[(x * y), $MachinePrecision], 1.7e+37], t$95$1, t$95$3]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(c \cdot i\right) \cdot \left(a \cdot -2\right)\\
t_2 := 2 \cdot \left(z \cdot t\right)\\
t_3 := \left(x \cdot y\right) \cdot 2\\
\mathbf{if}\;x \cdot y \leq -1.05 \cdot 10^{+49}:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;x \cdot y \leq -3.4 \cdot 10^{-9}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \cdot y \leq -3.2 \cdot 10^{-67}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;x \cdot y \leq -5.8 \cdot 10^{-242}:\\
\;\;\;\;i \cdot \left(a \cdot \left(c \cdot -2\right)\right)\\
\mathbf{elif}\;x \cdot y \leq 8.2 \cdot 10^{-81}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;x \cdot y \leq 1.7 \cdot 10^{+37}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_3\\
\end{array}
\end{array}
if (*.f64 x y) < -1.05000000000000005e49 or 1.70000000000000003e37 < (*.f64 x y) Initial program 90.1%
Taylor expanded in x around inf 60.1%
if -1.05000000000000005e49 < (*.f64 x y) < -3.3999999999999998e-9 or 8.19999999999999968e-81 < (*.f64 x y) < 1.70000000000000003e37Initial program 84.6%
Taylor expanded in a around inf 49.5%
mul-1-neg49.5%
*-commutative49.5%
associate-*l*39.4%
*-commutative39.4%
distribute-rgt-neg-in39.4%
*-commutative39.4%
distribute-rgt-neg-in39.4%
Simplified39.4%
Taylor expanded in c around 0 49.5%
associate-*r*49.5%
Simplified49.5%
if -3.3999999999999998e-9 < (*.f64 x y) < -3.20000000000000021e-67 or -5.8000000000000002e-242 < (*.f64 x y) < 8.19999999999999968e-81Initial program 91.9%
Taylor expanded in z around inf 48.7%
if -3.20000000000000021e-67 < (*.f64 x y) < -5.8000000000000002e-242Initial program 91.9%
Taylor expanded in a around inf 35.3%
mul-1-neg35.3%
*-commutative35.3%
associate-*l*34.4%
*-commutative34.4%
distribute-rgt-neg-in34.4%
*-commutative34.4%
distribute-rgt-neg-in34.4%
Simplified34.4%
Taylor expanded in c around 0 35.3%
*-commutative35.3%
associate-*r*35.3%
*-commutative35.3%
associate-*r*35.3%
associate-*r*35.3%
*-commutative35.3%
Simplified35.3%
Final simplification51.9%
(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 (- INFINITY))
(* c (+ (* -2.0 (* a i)) (* -2.0 (* b (* c i)))))
(if (<= t_2 1e+300)
(* (- (+ (* x y) (* z t)) (* t_2 i)) 2.0)
(* 2.0 (- (* z t) (* 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 <= -((double) INFINITY)) {
tmp = c * ((-2.0 * (a * i)) + (-2.0 * (b * (c * i))));
} else if (t_2 <= 1e+300) {
tmp = (((x * y) + (z * t)) - (t_2 * i)) * 2.0;
} else {
tmp = 2.0 * ((z * t) - (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 = c * t_1;
double tmp;
if (t_2 <= -Double.POSITIVE_INFINITY) {
tmp = c * ((-2.0 * (a * i)) + (-2.0 * (b * (c * i))));
} else if (t_2 <= 1e+300) {
tmp = (((x * y) + (z * t)) - (t_2 * i)) * 2.0;
} else {
tmp = 2.0 * ((z * t) - (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 <= -math.inf: tmp = c * ((-2.0 * (a * i)) + (-2.0 * (b * (c * i)))) elif t_2 <= 1e+300: tmp = (((x * y) + (z * t)) - (t_2 * i)) * 2.0 else: tmp = 2.0 * ((z * t) - (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 <= Float64(-Inf)) tmp = Float64(c * Float64(Float64(-2.0 * Float64(a * i)) + Float64(-2.0 * Float64(b * Float64(c * i))))); elseif (t_2 <= 1e+300) tmp = Float64(Float64(Float64(Float64(x * y) + Float64(z * t)) - Float64(t_2 * i)) * 2.0); else tmp = Float64(2.0 * Float64(Float64(z * t) - Float64(c * Float64(t_1 * i)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = a + (b * c); t_2 = c * t_1; tmp = 0.0; if (t_2 <= -Inf) tmp = c * ((-2.0 * (a * i)) + (-2.0 * (b * (c * i)))); elseif (t_2 <= 1e+300) tmp = (((x * y) + (z * t)) - (t_2 * i)) * 2.0; else tmp = 2.0 * ((z * t) - (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, (-Infinity)], N[(c * N[(N[(-2.0 * N[(a * i), $MachinePrecision]), $MachinePrecision] + N[(-2.0 * N[(b * N[(c * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, 1e+300], N[(N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] - N[(t$95$2 * i), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision], N[(2.0 * N[(N[(z * t), $MachinePrecision] - N[(c * N[(t$95$1 * i), $MachinePrecision]), $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 -\infty:\\
\;\;\;\;c \cdot \left(-2 \cdot \left(a \cdot i\right) + -2 \cdot \left(b \cdot \left(c \cdot i\right)\right)\right)\\
\mathbf{elif}\;t\_2 \leq 10^{+300}:\\
\;\;\;\;\left(\left(x \cdot y + z \cdot t\right) - t\_2 \cdot i\right) \cdot 2\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(z \cdot t - c \cdot \left(t\_1 \cdot i\right)\right)\\
\end{array}
\end{array}
if (*.f64 (+.f64 a (*.f64 b c)) c) < -inf.0Initial program 70.6%
Taylor expanded in i around inf 91.7%
Taylor expanded in c around 0 94.4%
if -inf.0 < (*.f64 (+.f64 a (*.f64 b c)) c) < 1.0000000000000001e300Initial program 97.7%
if 1.0000000000000001e300 < (*.f64 (+.f64 a (*.f64 b c)) c) Initial program 70.4%
Taylor expanded in x around 0 92.3%
Final simplification96.5%
(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))))
(* t (* 2.0 (+ z (* x (/ y t))))))))
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 = t * (2.0 * (z + (x * (y / t))));
}
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 = t * (2.0 * (z + (x * (y / t))));
}
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 = t * (2.0 * (z + (x * (y / t)))) 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(t * Float64(2.0 * Float64(z + Float64(x * Float64(y / t))))); 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 = t * (2.0 * (z + (x * (y / t)))); 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[(t * N[(2.0 * N[(z + N[(x * N[(y / t), $MachinePrecision]), $MachinePrecision]), $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}:\\
\;\;\;\;t \cdot \left(2 \cdot \left(z + x \cdot \frac{y}{t}\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 93.5%
fma-define93.5%
associate-*l*98.8%
Simplified98.8%
fma-define98.8%
+-commutative98.8%
Applied egg-rr98.8%
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 c around 0 66.7%
Taylor expanded in t around inf 77.8%
distribute-lft-out77.8%
associate-/l*77.8%
Simplified77.8%
Final simplification98.1%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* 2.0 (+ (* x y) (* z t))))
(t_2 (* -2.0 (* c (* (+ a (* b c)) i)))))
(if (<= c -4.1e+135)
t_2
(if (<= c -4e+111)
t_1
(if (<= c -3.2e+46)
t_2
(if (<= c 3.3e+28)
t_1
(* 2.0 (* x (- y (/ (* c (* (* b c) i)) x))))))))))
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) + (z * t));
double t_2 = -2.0 * (c * ((a + (b * c)) * i));
double tmp;
if (c <= -4.1e+135) {
tmp = t_2;
} else if (c <= -4e+111) {
tmp = t_1;
} else if (c <= -3.2e+46) {
tmp = t_2;
} else if (c <= 3.3e+28) {
tmp = t_1;
} else {
tmp = 2.0 * (x * (y - ((c * ((b * c) * i)) / 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) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = 2.0d0 * ((x * y) + (z * t))
t_2 = (-2.0d0) * (c * ((a + (b * c)) * i))
if (c <= (-4.1d+135)) then
tmp = t_2
else if (c <= (-4d+111)) then
tmp = t_1
else if (c <= (-3.2d+46)) then
tmp = t_2
else if (c <= 3.3d+28) then
tmp = t_1
else
tmp = 2.0d0 * (x * (y - ((c * ((b * c) * i)) / 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 t_1 = 2.0 * ((x * y) + (z * t));
double t_2 = -2.0 * (c * ((a + (b * c)) * i));
double tmp;
if (c <= -4.1e+135) {
tmp = t_2;
} else if (c <= -4e+111) {
tmp = t_1;
} else if (c <= -3.2e+46) {
tmp = t_2;
} else if (c <= 3.3e+28) {
tmp = t_1;
} else {
tmp = 2.0 * (x * (y - ((c * ((b * c) * i)) / x)));
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = 2.0 * ((x * y) + (z * t)) t_2 = -2.0 * (c * ((a + (b * c)) * i)) tmp = 0 if c <= -4.1e+135: tmp = t_2 elif c <= -4e+111: tmp = t_1 elif c <= -3.2e+46: tmp = t_2 elif c <= 3.3e+28: tmp = t_1 else: tmp = 2.0 * (x * (y - ((c * ((b * c) * i)) / x))) return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(2.0 * Float64(Float64(x * y) + Float64(z * t))) t_2 = Float64(-2.0 * Float64(c * Float64(Float64(a + Float64(b * c)) * i))) tmp = 0.0 if (c <= -4.1e+135) tmp = t_2; elseif (c <= -4e+111) tmp = t_1; elseif (c <= -3.2e+46) tmp = t_2; elseif (c <= 3.3e+28) tmp = t_1; else tmp = Float64(2.0 * Float64(x * Float64(y - Float64(Float64(c * Float64(Float64(b * c) * i)) / x)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = 2.0 * ((x * y) + (z * t)); t_2 = -2.0 * (c * ((a + (b * c)) * i)); tmp = 0.0; if (c <= -4.1e+135) tmp = t_2; elseif (c <= -4e+111) tmp = t_1; elseif (c <= -3.2e+46) tmp = t_2; elseif (c <= 3.3e+28) tmp = t_1; else tmp = 2.0 * (x * (y - ((c * ((b * c) * i)) / x))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(2.0 * N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(-2.0 * N[(c * N[(N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[c, -4.1e+135], t$95$2, If[LessEqual[c, -4e+111], t$95$1, If[LessEqual[c, -3.2e+46], t$95$2, If[LessEqual[c, 3.3e+28], t$95$1, N[(2.0 * N[(x * N[(y - N[(N[(c * N[(N[(b * c), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := 2 \cdot \left(x \cdot y + z \cdot t\right)\\
t_2 := -2 \cdot \left(c \cdot \left(\left(a + b \cdot c\right) \cdot i\right)\right)\\
\mathbf{if}\;c \leq -4.1 \cdot 10^{+135}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;c \leq -4 \cdot 10^{+111}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;c \leq -3.2 \cdot 10^{+46}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;c \leq 3.3 \cdot 10^{+28}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(x \cdot \left(y - \frac{c \cdot \left(\left(b \cdot c\right) \cdot i\right)}{x}\right)\right)\\
\end{array}
\end{array}
if c < -4.1e135 or -3.99999999999999983e111 < c < -3.1999999999999998e46Initial program 81.2%
Taylor expanded in i around inf 87.9%
Taylor expanded in i around 0 87.9%
if -4.1e135 < c < -3.99999999999999983e111 or -3.1999999999999998e46 < c < 3.3e28Initial program 97.8%
Taylor expanded in c around 0 81.2%
if 3.3e28 < c Initial program 80.6%
Taylor expanded in x around inf 86.9%
Taylor expanded in t around 0 83.7%
Taylor expanded in a around 0 78.9%
Final simplification82.1%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* 2.0 (+ (* x y) (* z t))))
(t_2 (* -2.0 (* c (* (+ a (* b c)) i)))))
(if (<= c -2.6e+135)
t_2
(if (<= c -2.75e+112)
t_1
(if (<= c -1.35e+47)
t_2
(if (<= c 2.15e+39) t_1 (* 2.0 (- (* z t) (* c (* (* b c) i))))))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = 2.0 * ((x * y) + (z * t));
double t_2 = -2.0 * (c * ((a + (b * c)) * i));
double tmp;
if (c <= -2.6e+135) {
tmp = t_2;
} else if (c <= -2.75e+112) {
tmp = t_1;
} else if (c <= -1.35e+47) {
tmp = t_2;
} else if (c <= 2.15e+39) {
tmp = t_1;
} else {
tmp = 2.0 * ((z * t) - (c * ((b * c) * i)));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = 2.0d0 * ((x * y) + (z * t))
t_2 = (-2.0d0) * (c * ((a + (b * c)) * i))
if (c <= (-2.6d+135)) then
tmp = t_2
else if (c <= (-2.75d+112)) then
tmp = t_1
else if (c <= (-1.35d+47)) then
tmp = t_2
else if (c <= 2.15d+39) then
tmp = t_1
else
tmp = 2.0d0 * ((z * t) - (c * ((b * c) * i)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = 2.0 * ((x * y) + (z * t));
double t_2 = -2.0 * (c * ((a + (b * c)) * i));
double tmp;
if (c <= -2.6e+135) {
tmp = t_2;
} else if (c <= -2.75e+112) {
tmp = t_1;
} else if (c <= -1.35e+47) {
tmp = t_2;
} else if (c <= 2.15e+39) {
tmp = t_1;
} else {
tmp = 2.0 * ((z * t) - (c * ((b * c) * i)));
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = 2.0 * ((x * y) + (z * t)) t_2 = -2.0 * (c * ((a + (b * c)) * i)) tmp = 0 if c <= -2.6e+135: tmp = t_2 elif c <= -2.75e+112: tmp = t_1 elif c <= -1.35e+47: tmp = t_2 elif c <= 2.15e+39: tmp = t_1 else: tmp = 2.0 * ((z * t) - (c * ((b * c) * i))) return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(2.0 * Float64(Float64(x * y) + Float64(z * t))) t_2 = Float64(-2.0 * Float64(c * Float64(Float64(a + Float64(b * c)) * i))) tmp = 0.0 if (c <= -2.6e+135) tmp = t_2; elseif (c <= -2.75e+112) tmp = t_1; elseif (c <= -1.35e+47) tmp = t_2; elseif (c <= 2.15e+39) tmp = t_1; else tmp = Float64(2.0 * Float64(Float64(z * t) - Float64(c * Float64(Float64(b * c) * i)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = 2.0 * ((x * y) + (z * t)); t_2 = -2.0 * (c * ((a + (b * c)) * i)); tmp = 0.0; if (c <= -2.6e+135) tmp = t_2; elseif (c <= -2.75e+112) tmp = t_1; elseif (c <= -1.35e+47) tmp = t_2; elseif (c <= 2.15e+39) tmp = t_1; else tmp = 2.0 * ((z * t) - (c * ((b * c) * i))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(2.0 * N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(-2.0 * N[(c * N[(N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[c, -2.6e+135], t$95$2, If[LessEqual[c, -2.75e+112], t$95$1, If[LessEqual[c, -1.35e+47], t$95$2, If[LessEqual[c, 2.15e+39], t$95$1, N[(2.0 * N[(N[(z * t), $MachinePrecision] - N[(c * N[(N[(b * c), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := 2 \cdot \left(x \cdot y + z \cdot t\right)\\
t_2 := -2 \cdot \left(c \cdot \left(\left(a + b \cdot c\right) \cdot i\right)\right)\\
\mathbf{if}\;c \leq -2.6 \cdot 10^{+135}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;c \leq -2.75 \cdot 10^{+112}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;c \leq -1.35 \cdot 10^{+47}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;c \leq 2.15 \cdot 10^{+39}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(z \cdot t - c \cdot \left(\left(b \cdot c\right) \cdot i\right)\right)\\
\end{array}
\end{array}
if c < -2.6e135 or -2.75000000000000013e112 < c < -1.34999999999999998e47Initial program 81.2%
Taylor expanded in i around inf 87.9%
Taylor expanded in i around 0 87.9%
if -2.6e135 < c < -2.75000000000000013e112 or -1.34999999999999998e47 < c < 2.15e39Initial program 97.8%
Taylor expanded in c around 0 81.4%
if 2.15e39 < c Initial program 79.9%
Taylor expanded in x around 0 87.9%
Taylor expanded in a around 0 79.5%
Final simplification82.4%
(FPCore (x y z t a b c i)
:precision binary64
(if (or (<= c -2.6e+135)
(and (not (<= c -8.2e+112))
(or (<= c -1.2e+45) (not (<= c 1.05e+37)))))
(* -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 <= -2.6e+135) || (!(c <= -8.2e+112) && ((c <= -1.2e+45) || !(c <= 1.05e+37)))) {
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 <= (-2.6d+135)) .or. (.not. (c <= (-8.2d+112))) .and. (c <= (-1.2d+45)) .or. (.not. (c <= 1.05d+37))) 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 <= -2.6e+135) || (!(c <= -8.2e+112) && ((c <= -1.2e+45) || !(c <= 1.05e+37)))) {
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 <= -2.6e+135) or (not (c <= -8.2e+112) and ((c <= -1.2e+45) or not (c <= 1.05e+37))): 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 <= -2.6e+135) || (!(c <= -8.2e+112) && ((c <= -1.2e+45) || !(c <= 1.05e+37)))) tmp = Float64(-2.0 * Float64(c * Float64(Float64(a + Float64(b * c)) * i))); else tmp = Float64(2.0 * Float64(Float64(x * y) + Float64(z * t))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if ((c <= -2.6e+135) || (~((c <= -8.2e+112)) && ((c <= -1.2e+45) || ~((c <= 1.05e+37))))) 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, -2.6e+135], And[N[Not[LessEqual[c, -8.2e+112]], $MachinePrecision], Or[LessEqual[c, -1.2e+45], N[Not[LessEqual[c, 1.05e+37]], $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 -2.6 \cdot 10^{+135} \lor \neg \left(c \leq -8.2 \cdot 10^{+112}\right) \land \left(c \leq -1.2 \cdot 10^{+45} \lor \neg \left(c \leq 1.05 \cdot 10^{+37}\right)\right):\\
\;\;\;\;-2 \cdot \left(c \cdot \left(\left(a + b \cdot c\right) \cdot i\right)\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(x \cdot y + z \cdot t\right)\\
\end{array}
\end{array}
if c < -2.6e135 or -8.19999999999999951e112 < c < -1.19999999999999995e45 or 1.0500000000000001e37 < c Initial program 80.6%
Taylor expanded in i around inf 83.5%
Taylor expanded in i around 0 83.5%
if -2.6e135 < c < -8.19999999999999951e112 or -1.19999999999999995e45 < c < 1.0500000000000001e37Initial program 97.8%
Taylor expanded in c around 0 81.4%
Final simplification82.3%
(FPCore (x y z t a b c i)
:precision binary64
(if (<= (* x y) -1e+54)
(* y (* 2.0 (+ x (* t (/ z y)))))
(if (<= (* x y) 2e+113)
(* 2.0 (- (* z t) (* c (* (+ a (* b c)) i))))
(* 2.0 (* x (- y (/ (* c (* (* b c) i)) x)))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((x * y) <= -1e+54) {
tmp = y * (2.0 * (x + (t * (z / y))));
} else if ((x * y) <= 2e+113) {
tmp = 2.0 * ((z * t) - (c * ((a + (b * c)) * i)));
} else {
tmp = 2.0 * (x * (y - ((c * ((b * c) * i)) / 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) <= (-1d+54)) then
tmp = y * (2.0d0 * (x + (t * (z / y))))
else if ((x * y) <= 2d+113) then
tmp = 2.0d0 * ((z * t) - (c * ((a + (b * c)) * i)))
else
tmp = 2.0d0 * (x * (y - ((c * ((b * c) * i)) / 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) <= -1e+54) {
tmp = y * (2.0 * (x + (t * (z / y))));
} else if ((x * y) <= 2e+113) {
tmp = 2.0 * ((z * t) - (c * ((a + (b * c)) * i)));
} else {
tmp = 2.0 * (x * (y - ((c * ((b * c) * i)) / x)));
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if (x * y) <= -1e+54: tmp = y * (2.0 * (x + (t * (z / y)))) elif (x * y) <= 2e+113: tmp = 2.0 * ((z * t) - (c * ((a + (b * c)) * i))) else: tmp = 2.0 * (x * (y - ((c * ((b * c) * i)) / x))) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (Float64(x * y) <= -1e+54) tmp = Float64(y * Float64(2.0 * Float64(x + Float64(t * Float64(z / y))))); elseif (Float64(x * y) <= 2e+113) 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(c * Float64(Float64(b * c) * i)) / x)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if ((x * y) <= -1e+54) tmp = y * (2.0 * (x + (t * (z / y)))); elseif ((x * y) <= 2e+113) tmp = 2.0 * ((z * t) - (c * ((a + (b * c)) * i))); else tmp = 2.0 * (x * (y - ((c * ((b * c) * i)) / x))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[N[(x * y), $MachinePrecision], -1e+54], N[(y * N[(2.0 * N[(x + N[(t * N[(z / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 2e+113], 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[(c * N[(N[(b * c), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \cdot y \leq -1 \cdot 10^{+54}:\\
\;\;\;\;y \cdot \left(2 \cdot \left(x + t \cdot \frac{z}{y}\right)\right)\\
\mathbf{elif}\;x \cdot y \leq 2 \cdot 10^{+113}:\\
\;\;\;\;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{c \cdot \left(\left(b \cdot c\right) \cdot i\right)}{x}\right)\right)\\
\end{array}
\end{array}
if (*.f64 x y) < -1.0000000000000001e54Initial program 95.3%
Taylor expanded in c around 0 79.9%
Taylor expanded in y around inf 79.9%
distribute-lft-out79.9%
associate-/l*79.8%
Simplified79.8%
if -1.0000000000000001e54 < (*.f64 x y) < 2e113Initial program 89.2%
Taylor expanded in x around 0 85.6%
if 2e113 < (*.f64 x y) Initial program 89.0%
Taylor expanded in x around inf 89.1%
Taylor expanded in t around 0 82.7%
Taylor expanded in a around 0 84.7%
Final simplification84.5%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ (* x y) (* z t))))
(if (<= c -29000000000.0)
(* 2.0 (- (* z t) (* c (* (+ a (* b c)) i))))
(if (<= c 1.45e-80)
(* 2.0 (- t_1 (* a (* c i))))
(* 2.0 (- t_1 (* (* b c) (* c i))))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = (x * y) + (z * t);
double tmp;
if (c <= -29000000000.0) {
tmp = 2.0 * ((z * t) - (c * ((a + (b * c)) * i)));
} else if (c <= 1.45e-80) {
tmp = 2.0 * (t_1 - (a * (c * i)));
} else {
tmp = 2.0 * (t_1 - ((b * 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) :: t_1
real(8) :: tmp
t_1 = (x * y) + (z * t)
if (c <= (-29000000000.0d0)) then
tmp = 2.0d0 * ((z * t) - (c * ((a + (b * c)) * i)))
else if (c <= 1.45d-80) then
tmp = 2.0d0 * (t_1 - (a * (c * i)))
else
tmp = 2.0d0 * (t_1 - ((b * 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 t_1 = (x * y) + (z * t);
double tmp;
if (c <= -29000000000.0) {
tmp = 2.0 * ((z * t) - (c * ((a + (b * c)) * i)));
} else if (c <= 1.45e-80) {
tmp = 2.0 * (t_1 - (a * (c * i)));
} else {
tmp = 2.0 * (t_1 - ((b * c) * (c * i)));
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = (x * y) + (z * t) tmp = 0 if c <= -29000000000.0: tmp = 2.0 * ((z * t) - (c * ((a + (b * c)) * i))) elif c <= 1.45e-80: tmp = 2.0 * (t_1 - (a * (c * i))) else: tmp = 2.0 * (t_1 - ((b * c) * (c * i))) return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(Float64(x * y) + Float64(z * t)) tmp = 0.0 if (c <= -29000000000.0) tmp = Float64(2.0 * Float64(Float64(z * t) - Float64(c * Float64(Float64(a + Float64(b * c)) * i)))); elseif (c <= 1.45e-80) tmp = Float64(2.0 * Float64(t_1 - Float64(a * Float64(c * i)))); else tmp = Float64(2.0 * Float64(t_1 - Float64(Float64(b * c) * Float64(c * i)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = (x * y) + (z * t); tmp = 0.0; if (c <= -29000000000.0) tmp = 2.0 * ((z * t) - (c * ((a + (b * c)) * i))); elseif (c <= 1.45e-80) tmp = 2.0 * (t_1 - (a * (c * i))); else tmp = 2.0 * (t_1 - ((b * c) * (c * i))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[c, -29000000000.0], N[(2.0 * N[(N[(z * t), $MachinePrecision] - N[(c * N[(N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[c, 1.45e-80], N[(2.0 * N[(t$95$1 - N[(a * N[(c * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(t$95$1 - N[(N[(b * c), $MachinePrecision] * N[(c * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot y + z \cdot t\\
\mathbf{if}\;c \leq -29000000000:\\
\;\;\;\;2 \cdot \left(z \cdot t - c \cdot \left(\left(a + b \cdot c\right) \cdot i\right)\right)\\
\mathbf{elif}\;c \leq 1.45 \cdot 10^{-80}:\\
\;\;\;\;2 \cdot \left(t\_1 - a \cdot \left(c \cdot i\right)\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(t\_1 - \left(b \cdot c\right) \cdot \left(c \cdot i\right)\right)\\
\end{array}
\end{array}
if c < -2.9e10Initial program 83.1%
Taylor expanded in x around 0 88.8%
if -2.9e10 < c < 1.44999999999999999e-80Initial program 99.9%
fma-define99.9%
associate-*l*100.0%
Simplified100.0%
fma-define99.9%
+-commutative99.9%
Applied egg-rr99.9%
Taylor expanded in c around 0 91.9%
Taylor expanded in c around 0 96.6%
if 1.44999999999999999e-80 < c Initial program 83.1%
fma-define83.1%
associate-*l*94.9%
Simplified94.9%
fma-define94.9%
+-commutative94.9%
Applied egg-rr94.9%
Taylor expanded in a around 0 88.7%
Final simplification92.0%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= c -65000000000000.0) (not (<= c 6.2e+34))) (* 2.0 (- (* z t) (* c (* (+ a (* b c)) i)))) (* 2.0 (- (+ (* x y) (* z t)) (* i (* a c))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((c <= -65000000000000.0) || !(c <= 6.2e+34)) {
tmp = 2.0 * ((z * t) - (c * ((a + (b * c)) * i)));
} else {
tmp = 2.0 * (((x * y) + (z * t)) - (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 ((c <= (-65000000000000.0d0)) .or. (.not. (c <= 6.2d+34))) then
tmp = 2.0d0 * ((z * t) - (c * ((a + (b * c)) * i)))
else
tmp = 2.0d0 * (((x * y) + (z * t)) - (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 ((c <= -65000000000000.0) || !(c <= 6.2e+34)) {
tmp = 2.0 * ((z * t) - (c * ((a + (b * c)) * i)));
} else {
tmp = 2.0 * (((x * y) + (z * t)) - (i * (a * c)));
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if (c <= -65000000000000.0) or not (c <= 6.2e+34): tmp = 2.0 * ((z * t) - (c * ((a + (b * c)) * i))) else: tmp = 2.0 * (((x * y) + (z * t)) - (i * (a * c))) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if ((c <= -65000000000000.0) || !(c <= 6.2e+34)) tmp = Float64(2.0 * Float64(Float64(z * t) - Float64(c * Float64(Float64(a + Float64(b * c)) * i)))); else tmp = Float64(2.0 * Float64(Float64(Float64(x * y) + Float64(z * t)) - Float64(i * Float64(a * c)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if ((c <= -65000000000000.0) || ~((c <= 6.2e+34))) tmp = 2.0 * ((z * t) - (c * ((a + (b * c)) * i))); else tmp = 2.0 * (((x * y) + (z * t)) - (i * (a * c))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[c, -65000000000000.0], N[Not[LessEqual[c, 6.2e+34]], $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[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] - N[(i * N[(a * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;c \leq -65000000000000 \lor \neg \left(c \leq 6.2 \cdot 10^{+34}\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(\left(x \cdot y + z \cdot t\right) - i \cdot \left(a \cdot c\right)\right)\\
\end{array}
\end{array}
if c < -6.5e13 or 6.19999999999999955e34 < c Initial program 81.6%
Taylor expanded in x around 0 88.4%
if -6.5e13 < c < 6.19999999999999955e34Initial program 98.3%
Taylor expanded in a around inf 93.9%
*-commutative93.9%
Simplified93.9%
Final simplification91.2%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= c -4400000000000.0) (not (<= c 2.75e+38))) (* 2.0 (- (* z t) (* c (* (+ a (* b c)) i)))) (* 2.0 (- (+ (* x y) (* z t)) (* a (* c i))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((c <= -4400000000000.0) || !(c <= 2.75e+38)) {
tmp = 2.0 * ((z * t) - (c * ((a + (b * c)) * i)));
} else {
tmp = 2.0 * (((x * y) + (z * t)) - (a * (c * i)));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: tmp
if ((c <= (-4400000000000.0d0)) .or. (.not. (c <= 2.75d+38))) then
tmp = 2.0d0 * ((z * t) - (c * ((a + (b * c)) * i)))
else
tmp = 2.0d0 * (((x * y) + (z * t)) - (a * (c * i)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((c <= -4400000000000.0) || !(c <= 2.75e+38)) {
tmp = 2.0 * ((z * t) - (c * ((a + (b * c)) * i)));
} else {
tmp = 2.0 * (((x * y) + (z * t)) - (a * (c * i)));
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if (c <= -4400000000000.0) or not (c <= 2.75e+38): tmp = 2.0 * ((z * t) - (c * ((a + (b * c)) * i))) else: tmp = 2.0 * (((x * y) + (z * t)) - (a * (c * i))) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if ((c <= -4400000000000.0) || !(c <= 2.75e+38)) tmp = Float64(2.0 * Float64(Float64(z * t) - Float64(c * Float64(Float64(a + Float64(b * c)) * i)))); else tmp = Float64(2.0 * Float64(Float64(Float64(x * y) + Float64(z * t)) - Float64(a * Float64(c * i)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if ((c <= -4400000000000.0) || ~((c <= 2.75e+38))) tmp = 2.0 * ((z * t) - (c * ((a + (b * c)) * i))); else tmp = 2.0 * (((x * y) + (z * t)) - (a * (c * i))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[c, -4400000000000.0], N[Not[LessEqual[c, 2.75e+38]], $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[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] - N[(a * N[(c * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;c \leq -4400000000000 \lor \neg \left(c \leq 2.75 \cdot 10^{+38}\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(\left(x \cdot y + z \cdot t\right) - a \cdot \left(c \cdot i\right)\right)\\
\end{array}
\end{array}
if c < -4.4e12 or 2.7500000000000002e38 < c Initial program 81.6%
Taylor expanded in x around 0 88.4%
if -4.4e12 < c < 2.7500000000000002e38Initial program 98.3%
fma-define98.4%
associate-*l*98.4%
Simplified98.4%
fma-define98.4%
+-commutative98.4%
Applied egg-rr98.4%
Taylor expanded in c around 0 91.8%
Taylor expanded in c around 0 94.0%
Final simplification91.2%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= c -5.5e+146) (and (not (<= c -5.8e+109)) (<= c -1.3e+51))) (* (* 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 <= -5.5e+146) || (!(c <= -5.8e+109) && (c <= -1.3e+51))) {
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 <= (-5.5d+146)) .or. (.not. (c <= (-5.8d+109))) .and. (c <= (-1.3d+51))) 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 <= -5.5e+146) || (!(c <= -5.8e+109) && (c <= -1.3e+51))) {
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 <= -5.5e+146) or (not (c <= -5.8e+109) and (c <= -1.3e+51)): 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 <= -5.5e+146) || (!(c <= -5.8e+109) && (c <= -1.3e+51))) 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 <= -5.5e+146) || (~((c <= -5.8e+109)) && (c <= -1.3e+51))) 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[Or[LessEqual[c, -5.5e+146], And[N[Not[LessEqual[c, -5.8e+109]], $MachinePrecision], LessEqual[c, -1.3e+51]]], 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 -5.5 \cdot 10^{+146} \lor \neg \left(c \leq -5.8 \cdot 10^{+109}\right) \land c \leq -1.3 \cdot 10^{+51}:\\
\;\;\;\;\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 < -5.5000000000000004e146 or -5.8e109 < c < -1.3000000000000001e51Initial program 81.7%
Taylor expanded in a around inf 49.8%
mul-1-neg49.8%
*-commutative49.8%
associate-*l*42.7%
*-commutative42.7%
distribute-rgt-neg-in42.7%
*-commutative42.7%
distribute-rgt-neg-in42.7%
Simplified42.7%
Taylor expanded in c around 0 49.8%
associate-*r*49.8%
Simplified49.8%
if -5.5000000000000004e146 < c < -5.8e109 or -1.3000000000000001e51 < c Initial program 92.3%
Taylor expanded in c around 0 65.5%
Final simplification62.3%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= (* x y) -122.0) (not (<= (* x y) 7.2e+115))) (* (* 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) <= -122.0) || !((x * y) <= 7.2e+115)) {
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) <= (-122.0d0)) .or. (.not. ((x * y) <= 7.2d+115))) 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) <= -122.0) || !((x * y) <= 7.2e+115)) {
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) <= -122.0) or not ((x * y) <= 7.2e+115): 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) <= -122.0) || !(Float64(x * y) <= 7.2e+115)) 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) <= -122.0) || ~(((x * y) <= 7.2e+115))) 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], -122.0], N[Not[LessEqual[N[(x * y), $MachinePrecision], 7.2e+115]], $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 -122 \lor \neg \left(x \cdot y \leq 7.2 \cdot 10^{+115}\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) < -122 or 7.2000000000000001e115 < (*.f64 x y) Initial program 91.2%
Taylor expanded in x around inf 59.4%
if -122 < (*.f64 x y) < 7.2000000000000001e115Initial program 89.5%
Taylor expanded in z around inf 37.5%
Final simplification46.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 90.2%
Taylor expanded in z around inf 28.7%
Final simplification28.7%
(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 2024059
(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))))