
(FPCore (x y z t a b c i) :precision binary64 (* 2.0 (- (+ (* x y) (* z t)) (* (* (+ a (* b c)) c) i))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return 2.0 * (((x * y) + (z * t)) - (((a + (b * c)) * c) * i));
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
code = 2.0d0 * (((x * y) + (z * t)) - (((a + (b * c)) * c) * i))
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return 2.0 * (((x * y) + (z * t)) - (((a + (b * c)) * c) * i));
}
def code(x, y, z, t, a, b, c, i): return 2.0 * (((x * y) + (z * t)) - (((a + (b * c)) * c) * i))
function code(x, y, z, t, a, b, c, i) return Float64(2.0 * Float64(Float64(Float64(x * y) + Float64(z * t)) - Float64(Float64(Float64(a + Float64(b * c)) * c) * i))) end
function tmp = code(x, y, z, t, a, b, c, i) tmp = 2.0 * (((x * y) + (z * t)) - (((a + (b * c)) * c) * i)); end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(2.0 * N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] - N[(N[(N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision] * c), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
2 \cdot \left(\left(x \cdot y + z \cdot t\right) - \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i\right)
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 11 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a b c i) :precision binary64 (* 2.0 (- (+ (* x y) (* z t)) (* (* (+ a (* b c)) c) i))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return 2.0 * (((x * y) + (z * t)) - (((a + (b * c)) * c) * i));
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
code = 2.0d0 * (((x * y) + (z * t)) - (((a + (b * c)) * c) * i))
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return 2.0 * (((x * y) + (z * t)) - (((a + (b * c)) * c) * i));
}
def code(x, y, z, t, a, b, c, i): return 2.0 * (((x * y) + (z * t)) - (((a + (b * c)) * c) * i))
function code(x, y, z, t, a, b, c, i) return Float64(2.0 * Float64(Float64(Float64(x * y) + Float64(z * t)) - Float64(Float64(Float64(a + Float64(b * c)) * c) * i))) end
function tmp = code(x, y, z, t, a, b, c, i) tmp = 2.0 * (((x * y) + (z * t)) - (((a + (b * c)) * c) * i)); end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(2.0 * N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] - N[(N[(N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision] * c), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
2 \cdot \left(\left(x \cdot y + z \cdot t\right) - \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i\right)
\end{array}
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ a (* b c))))
(if (<= (- (+ (* x y) (* z t)) (* (* c t_1) i)) INFINITY)
(* 2.0 (- (fma x y (* z t)) (* t_1 (* c i))))
(* 2.0 (* z (- t (* a (/ (* c i) z))))))))
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 = 2.0 * (z * (t - (a * ((c * i) / z))));
}
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(2.0 * Float64(z * Float64(t - Float64(a * Float64(Float64(c * i) / z))))); 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[(2.0 * N[(z * N[(t - N[(a * N[(N[(c * i), $MachinePrecision] / z), $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}:\\
\;\;\;\;2 \cdot \left(z \cdot \left(t - a \cdot \frac{c \cdot i}{z}\right)\right)\\
\end{array}
\end{array}
if (-.f64 (+.f64 (*.f64 x y) (*.f64 z t)) (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i)) < +inf.0Initial program 95.0%
fma-define95.0%
associate-*l*98.4%
Simplified98.4%
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 a around inf 33.3%
*-commutative33.3%
Simplified33.3%
Taylor expanded in x around 0 34.4%
Taylor expanded in z around inf 67.7%
mul-1-neg67.7%
unsub-neg67.7%
associate-/l*84.4%
Simplified84.4%
Final simplification98.1%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* 2.0 (* c (* (+ a (* b c)) (- i))))))
(if (<= c -1.15e+162)
t_1
(if (<= c -2.1e+138)
(* y (* 2.0 (+ x (* z (/ t y)))))
(if (<= c -4e-40)
t_1
(if (<= c 3.8e-40)
(* (+ (* x y) (* z t)) 2.0)
(if (or (<= c 2.45e-24) (not (<= c 1.45e+107)))
t_1
(* 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 = 2.0 * (c * ((a + (b * c)) * -i));
double tmp;
if (c <= -1.15e+162) {
tmp = t_1;
} else if (c <= -2.1e+138) {
tmp = y * (2.0 * (x + (z * (t / y))));
} else if (c <= -4e-40) {
tmp = t_1;
} else if (c <= 3.8e-40) {
tmp = ((x * y) + (z * t)) * 2.0;
} else if ((c <= 2.45e-24) || !(c <= 1.45e+107)) {
tmp = t_1;
} else {
tmp = t * (2.0 * (z + (x * (y / 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) :: t_1
real(8) :: tmp
t_1 = 2.0d0 * (c * ((a + (b * c)) * -i))
if (c <= (-1.15d+162)) then
tmp = t_1
else if (c <= (-2.1d+138)) then
tmp = y * (2.0d0 * (x + (z * (t / y))))
else if (c <= (-4d-40)) then
tmp = t_1
else if (c <= 3.8d-40) then
tmp = ((x * y) + (z * t)) * 2.0d0
else if ((c <= 2.45d-24) .or. (.not. (c <= 1.45d+107))) then
tmp = t_1
else
tmp = t * (2.0d0 * (z + (x * (y / 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 t_1 = 2.0 * (c * ((a + (b * c)) * -i));
double tmp;
if (c <= -1.15e+162) {
tmp = t_1;
} else if (c <= -2.1e+138) {
tmp = y * (2.0 * (x + (z * (t / y))));
} else if (c <= -4e-40) {
tmp = t_1;
} else if (c <= 3.8e-40) {
tmp = ((x * y) + (z * t)) * 2.0;
} else if ((c <= 2.45e-24) || !(c <= 1.45e+107)) {
tmp = t_1;
} else {
tmp = t * (2.0 * (z + (x * (y / t))));
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = 2.0 * (c * ((a + (b * c)) * -i)) tmp = 0 if c <= -1.15e+162: tmp = t_1 elif c <= -2.1e+138: tmp = y * (2.0 * (x + (z * (t / y)))) elif c <= -4e-40: tmp = t_1 elif c <= 3.8e-40: tmp = ((x * y) + (z * t)) * 2.0 elif (c <= 2.45e-24) or not (c <= 1.45e+107): tmp = t_1 else: tmp = t * (2.0 * (z + (x * (y / t)))) return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(2.0 * Float64(c * Float64(Float64(a + Float64(b * c)) * Float64(-i)))) tmp = 0.0 if (c <= -1.15e+162) tmp = t_1; elseif (c <= -2.1e+138) tmp = Float64(y * Float64(2.0 * Float64(x + Float64(z * Float64(t / y))))); elseif (c <= -4e-40) tmp = t_1; elseif (c <= 3.8e-40) tmp = Float64(Float64(Float64(x * y) + Float64(z * t)) * 2.0); elseif ((c <= 2.45e-24) || !(c <= 1.45e+107)) tmp = t_1; 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 = 2.0 * (c * ((a + (b * c)) * -i)); tmp = 0.0; if (c <= -1.15e+162) tmp = t_1; elseif (c <= -2.1e+138) tmp = y * (2.0 * (x + (z * (t / y)))); elseif (c <= -4e-40) tmp = t_1; elseif (c <= 3.8e-40) tmp = ((x * y) + (z * t)) * 2.0; elseif ((c <= 2.45e-24) || ~((c <= 1.45e+107))) tmp = t_1; 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[(2.0 * N[(c * N[(N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision] * (-i)), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[c, -1.15e+162], t$95$1, If[LessEqual[c, -2.1e+138], N[(y * N[(2.0 * N[(x + N[(z * N[(t / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[c, -4e-40], t$95$1, If[LessEqual[c, 3.8e-40], N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision], If[Or[LessEqual[c, 2.45e-24], N[Not[LessEqual[c, 1.45e+107]], $MachinePrecision]], t$95$1, 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 := 2 \cdot \left(c \cdot \left(\left(a + b \cdot c\right) \cdot \left(-i\right)\right)\right)\\
\mathbf{if}\;c \leq -1.15 \cdot 10^{+162}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;c \leq -2.1 \cdot 10^{+138}:\\
\;\;\;\;y \cdot \left(2 \cdot \left(x + z \cdot \frac{t}{y}\right)\right)\\
\mathbf{elif}\;c \leq -4 \cdot 10^{-40}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;c \leq 3.8 \cdot 10^{-40}:\\
\;\;\;\;\left(x \cdot y + z \cdot t\right) \cdot 2\\
\mathbf{elif}\;c \leq 2.45 \cdot 10^{-24} \lor \neg \left(c \leq 1.45 \cdot 10^{+107}\right):\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t \cdot \left(2 \cdot \left(z + x \cdot \frac{y}{t}\right)\right)\\
\end{array}
\end{array}
if c < -1.14999999999999997e162 or -2.10000000000000007e138 < c < -3.9999999999999997e-40 or 3.7999999999999999e-40 < c < 2.45e-24 or 1.44999999999999994e107 < c Initial program 87.4%
Taylor expanded in c around 0 89.7%
Taylor expanded in i around inf 86.1%
mul-1-neg86.1%
associate-*r*84.4%
distribute-rgt-neg-in84.4%
mul-1-neg84.4%
distribute-lft-out84.4%
associate-*r*86.1%
*-commutative86.1%
distribute-lft-out86.1%
mul-1-neg86.1%
distribute-lft-neg-in86.1%
distribute-rgt-neg-in86.1%
*-commutative86.1%
Simplified86.1%
if -1.14999999999999997e162 < c < -2.10000000000000007e138Initial program 75.6%
Taylor expanded in c around 0 75.6%
Taylor expanded in y around inf 75.2%
distribute-lft-out75.2%
associate-/l*86.9%
Simplified86.9%
Taylor expanded in t around 0 75.2%
*-commutative75.2%
associate-/l*63.1%
Simplified63.1%
if -3.9999999999999997e-40 < c < 3.7999999999999999e-40Initial program 99.0%
Taylor expanded in c around 0 83.9%
if 2.45e-24 < c < 1.44999999999999994e107Initial program 93.6%
Taylor expanded in c around 0 71.3%
Taylor expanded in t around inf 71.3%
distribute-lft-out71.3%
associate-/l*74.4%
Simplified74.4%
Final simplification83.0%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* 2.0 (* c (* (+ a (* b c)) (- i))))))
(if (<= c -1.15e+162)
t_1
(if (<= c -2.1e+138)
(* y (* 2.0 (+ x (* z (/ t y)))))
(if (or (<= c -7e+94) (not (<= c 5.8e+106)))
t_1
(* 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 t_1 = 2.0 * (c * ((a + (b * c)) * -i));
double tmp;
if (c <= -1.15e+162) {
tmp = t_1;
} else if (c <= -2.1e+138) {
tmp = y * (2.0 * (x + (z * (t / y))));
} else if ((c <= -7e+94) || !(c <= 5.8e+106)) {
tmp = t_1;
} 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) :: t_1
real(8) :: tmp
t_1 = 2.0d0 * (c * ((a + (b * c)) * -i))
if (c <= (-1.15d+162)) then
tmp = t_1
else if (c <= (-2.1d+138)) then
tmp = y * (2.0d0 * (x + (z * (t / y))))
else if ((c <= (-7d+94)) .or. (.not. (c <= 5.8d+106))) then
tmp = t_1
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 t_1 = 2.0 * (c * ((a + (b * c)) * -i));
double tmp;
if (c <= -1.15e+162) {
tmp = t_1;
} else if (c <= -2.1e+138) {
tmp = y * (2.0 * (x + (z * (t / y))));
} else if ((c <= -7e+94) || !(c <= 5.8e+106)) {
tmp = t_1;
} else {
tmp = 2.0 * (((x * y) + (z * t)) - (i * (a * c)));
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = 2.0 * (c * ((a + (b * c)) * -i)) tmp = 0 if c <= -1.15e+162: tmp = t_1 elif c <= -2.1e+138: tmp = y * (2.0 * (x + (z * (t / y)))) elif (c <= -7e+94) or not (c <= 5.8e+106): tmp = t_1 else: tmp = 2.0 * (((x * y) + (z * t)) - (i * (a * c))) return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(2.0 * Float64(c * Float64(Float64(a + Float64(b * c)) * Float64(-i)))) tmp = 0.0 if (c <= -1.15e+162) tmp = t_1; elseif (c <= -2.1e+138) tmp = Float64(y * Float64(2.0 * Float64(x + Float64(z * Float64(t / y))))); elseif ((c <= -7e+94) || !(c <= 5.8e+106)) tmp = t_1; 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) t_1 = 2.0 * (c * ((a + (b * c)) * -i)); tmp = 0.0; if (c <= -1.15e+162) tmp = t_1; elseif (c <= -2.1e+138) tmp = y * (2.0 * (x + (z * (t / y)))); elseif ((c <= -7e+94) || ~((c <= 5.8e+106))) tmp = t_1; 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_] := Block[{t$95$1 = N[(2.0 * N[(c * N[(N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision] * (-i)), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[c, -1.15e+162], t$95$1, If[LessEqual[c, -2.1e+138], N[(y * N[(2.0 * N[(x + N[(z * N[(t / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[c, -7e+94], N[Not[LessEqual[c, 5.8e+106]], $MachinePrecision]], t$95$1, 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}
t_1 := 2 \cdot \left(c \cdot \left(\left(a + b \cdot c\right) \cdot \left(-i\right)\right)\right)\\
\mathbf{if}\;c \leq -1.15 \cdot 10^{+162}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;c \leq -2.1 \cdot 10^{+138}:\\
\;\;\;\;y \cdot \left(2 \cdot \left(x + z \cdot \frac{t}{y}\right)\right)\\
\mathbf{elif}\;c \leq -7 \cdot 10^{+94} \lor \neg \left(c \leq 5.8 \cdot 10^{+106}\right):\\
\;\;\;\;t\_1\\
\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 < -1.14999999999999997e162 or -2.10000000000000007e138 < c < -6.9999999999999994e94 or 5.8000000000000004e106 < c Initial program 84.6%
Taylor expanded in c around 0 87.6%
Taylor expanded in i around inf 90.3%
mul-1-neg90.3%
associate-*r*88.0%
distribute-rgt-neg-in88.0%
mul-1-neg88.0%
distribute-lft-out88.0%
associate-*r*90.3%
*-commutative90.3%
distribute-lft-out90.3%
mul-1-neg90.3%
distribute-lft-neg-in90.3%
distribute-rgt-neg-in90.3%
*-commutative90.3%
Simplified90.3%
if -1.14999999999999997e162 < c < -2.10000000000000007e138Initial program 75.6%
Taylor expanded in c around 0 75.6%
Taylor expanded in y around inf 75.2%
distribute-lft-out75.2%
associate-/l*86.9%
Simplified86.9%
Taylor expanded in t around 0 75.2%
*-commutative75.2%
associate-/l*63.1%
Simplified63.1%
if -6.9999999999999994e94 < c < 5.8000000000000004e106Initial program 97.5%
Taylor expanded in a around inf 91.2%
*-commutative91.2%
Simplified91.2%
Final simplification90.0%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ (* x y) (* z t))))
(if (or (<= i -3.5e+77) (not (<= i 1e+32)))
(* (- t_1 (* (* c (+ a (* b c))) i)) 2.0)
(* 2.0 (- t_1 (* c (+ (* a i) (* b (* 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 ((i <= -3.5e+77) || !(i <= 1e+32)) {
tmp = (t_1 - ((c * (a + (b * c))) * i)) * 2.0;
} else {
tmp = 2.0 * (t_1 - (c * ((a * i) + (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) :: tmp
t_1 = (x * y) + (z * t)
if ((i <= (-3.5d+77)) .or. (.not. (i <= 1d+32))) then
tmp = (t_1 - ((c * (a + (b * c))) * i)) * 2.0d0
else
tmp = 2.0d0 * (t_1 - (c * ((a * i) + (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 = (x * y) + (z * t);
double tmp;
if ((i <= -3.5e+77) || !(i <= 1e+32)) {
tmp = (t_1 - ((c * (a + (b * c))) * i)) * 2.0;
} else {
tmp = 2.0 * (t_1 - (c * ((a * i) + (b * (c * i)))));
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = (x * y) + (z * t) tmp = 0 if (i <= -3.5e+77) or not (i <= 1e+32): tmp = (t_1 - ((c * (a + (b * c))) * i)) * 2.0 else: tmp = 2.0 * (t_1 - (c * ((a * i) + (b * (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 ((i <= -3.5e+77) || !(i <= 1e+32)) tmp = Float64(Float64(t_1 - Float64(Float64(c * Float64(a + Float64(b * c))) * i)) * 2.0); else tmp = Float64(2.0 * Float64(t_1 - Float64(c * Float64(Float64(a * i) + Float64(b * 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 ((i <= -3.5e+77) || ~((i <= 1e+32))) tmp = (t_1 - ((c * (a + (b * c))) * i)) * 2.0; else tmp = 2.0 * (t_1 - (c * ((a * i) + (b * (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[Or[LessEqual[i, -3.5e+77], N[Not[LessEqual[i, 1e+32]], $MachinePrecision]], N[(N[(t$95$1 - N[(N[(c * N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision], N[(2.0 * N[(t$95$1 - N[(c * N[(N[(a * i), $MachinePrecision] + N[(b * N[(c * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot y + z \cdot t\\
\mathbf{if}\;i \leq -3.5 \cdot 10^{+77} \lor \neg \left(i \leq 10^{+32}\right):\\
\;\;\;\;\left(t\_1 - \left(c \cdot \left(a + b \cdot c\right)\right) \cdot i\right) \cdot 2\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(t\_1 - c \cdot \left(a \cdot i + b \cdot \left(c \cdot i\right)\right)\right)\\
\end{array}
\end{array}
if i < -3.5000000000000001e77 or 1.00000000000000005e32 < i Initial program 96.9%
if -3.5000000000000001e77 < i < 1.00000000000000005e32Initial program 90.1%
Taylor expanded in c around 0 98.6%
Final simplification98.0%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ (* x y) (* z t))) (t_2 (* c (+ a (* b c)))))
(if (<= t_2 4e+305)
(* (- t_1 (* t_2 i)) 2.0)
(* 2.0 (- t_1 (* 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 = (x * y) + (z * t);
double t_2 = c * (a + (b * c));
double tmp;
if (t_2 <= 4e+305) {
tmp = (t_1 - (t_2 * i)) * 2.0;
} else {
tmp = 2.0 * (t_1 - (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 = (x * y) + (z * t)
t_2 = c * (a + (b * c))
if (t_2 <= 4d+305) then
tmp = (t_1 - (t_2 * i)) * 2.0d0
else
tmp = 2.0d0 * (t_1 - (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 = (x * y) + (z * t);
double t_2 = c * (a + (b * c));
double tmp;
if (t_2 <= 4e+305) {
tmp = (t_1 - (t_2 * i)) * 2.0;
} else {
tmp = 2.0 * (t_1 - (c * (b * (c * i))));
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = (x * y) + (z * t) t_2 = c * (a + (b * c)) tmp = 0 if t_2 <= 4e+305: tmp = (t_1 - (t_2 * i)) * 2.0 else: tmp = 2.0 * (t_1 - (c * (b * (c * i)))) return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(Float64(x * y) + Float64(z * t)) t_2 = Float64(c * Float64(a + Float64(b * c))) tmp = 0.0 if (t_2 <= 4e+305) tmp = Float64(Float64(t_1 - Float64(t_2 * i)) * 2.0); else tmp = Float64(2.0 * Float64(t_1 - Float64(c * Float64(b * 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); t_2 = c * (a + (b * c)); tmp = 0.0; if (t_2 <= 4e+305) tmp = (t_1 - (t_2 * i)) * 2.0; else tmp = 2.0 * (t_1 - (c * (b * (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]}, Block[{t$95$2 = N[(c * N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, 4e+305], N[(N[(t$95$1 - N[(t$95$2 * i), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision], N[(2.0 * N[(t$95$1 - N[(c * N[(b * N[(c * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot y + z \cdot t\\
t_2 := c \cdot \left(a + b \cdot c\right)\\
\mathbf{if}\;t\_2 \leq 4 \cdot 10^{+305}:\\
\;\;\;\;\left(t\_1 - t\_2 \cdot i\right) \cdot 2\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(t\_1 - c \cdot \left(b \cdot \left(c \cdot i\right)\right)\right)\\
\end{array}
\end{array}
if (*.f64 (+.f64 a (*.f64 b c)) c) < 3.9999999999999998e305Initial program 97.1%
if 3.9999999999999998e305 < (*.f64 (+.f64 a (*.f64 b c)) c) Initial program 73.0%
Taylor expanded in c around 0 86.9%
Taylor expanded in a around 0 84.8%
Final simplification94.9%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ (* x y) (* z t))))
(if (<= c -5.6e+98)
(* 2.0 (- t_1 (* c (* b (* c i)))))
(if (<= c 1.45e+107)
(* 2.0 (- t_1 (* i (* a c))))
(* 2.0 (* c (* (+ a (* b 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 <= -5.6e+98) {
tmp = 2.0 * (t_1 - (c * (b * (c * i))));
} else if (c <= 1.45e+107) {
tmp = 2.0 * (t_1 - (i * (a * c)));
} else {
tmp = 2.0 * (c * ((a + (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) :: tmp
t_1 = (x * y) + (z * t)
if (c <= (-5.6d+98)) then
tmp = 2.0d0 * (t_1 - (c * (b * (c * i))))
else if (c <= 1.45d+107) then
tmp = 2.0d0 * (t_1 - (i * (a * c)))
else
tmp = 2.0d0 * (c * ((a + (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 = (x * y) + (z * t);
double tmp;
if (c <= -5.6e+98) {
tmp = 2.0 * (t_1 - (c * (b * (c * i))));
} else if (c <= 1.45e+107) {
tmp = 2.0 * (t_1 - (i * (a * c)));
} else {
tmp = 2.0 * (c * ((a + (b * c)) * -i));
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = (x * y) + (z * t) tmp = 0 if c <= -5.6e+98: tmp = 2.0 * (t_1 - (c * (b * (c * i)))) elif c <= 1.45e+107: tmp = 2.0 * (t_1 - (i * (a * c))) else: tmp = 2.0 * (c * ((a + (b * 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 <= -5.6e+98) tmp = Float64(2.0 * Float64(t_1 - Float64(c * Float64(b * Float64(c * i))))); elseif (c <= 1.45e+107) tmp = Float64(2.0 * Float64(t_1 - Float64(i * Float64(a * c)))); else tmp = Float64(2.0 * Float64(c * Float64(Float64(a + Float64(b * c)) * Float64(-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 <= -5.6e+98) tmp = 2.0 * (t_1 - (c * (b * (c * i)))); elseif (c <= 1.45e+107) tmp = 2.0 * (t_1 - (i * (a * c))); else tmp = 2.0 * (c * ((a + (b * 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, -5.6e+98], N[(2.0 * N[(t$95$1 - N[(c * N[(b * N[(c * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[c, 1.45e+107], N[(2.0 * N[(t$95$1 - N[(i * N[(a * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(c * N[(N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision] * (-i)), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot y + z \cdot t\\
\mathbf{if}\;c \leq -5.6 \cdot 10^{+98}:\\
\;\;\;\;2 \cdot \left(t\_1 - c \cdot \left(b \cdot \left(c \cdot i\right)\right)\right)\\
\mathbf{elif}\;c \leq 1.45 \cdot 10^{+107}:\\
\;\;\;\;2 \cdot \left(t\_1 - i \cdot \left(a \cdot c\right)\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(c \cdot \left(\left(a + b \cdot c\right) \cdot \left(-i\right)\right)\right)\\
\end{array}
\end{array}
if c < -5.6000000000000001e98Initial program 84.5%
Taylor expanded in c around 0 95.3%
Taylor expanded in a around 0 95.3%
if -5.6000000000000001e98 < c < 1.44999999999999994e107Initial program 97.0%
Taylor expanded in a around inf 90.7%
*-commutative90.7%
Simplified90.7%
if 1.44999999999999994e107 < c Initial program 84.8%
Taylor expanded in c around 0 82.1%
Taylor expanded in i around inf 91.0%
mul-1-neg91.0%
associate-*r*86.7%
distribute-rgt-neg-in86.7%
mul-1-neg86.7%
distribute-lft-out86.7%
associate-*r*91.0%
*-commutative91.0%
distribute-lft-out91.0%
mul-1-neg91.0%
distribute-lft-neg-in91.0%
distribute-rgt-neg-in91.0%
*-commutative91.0%
Simplified91.0%
Final simplification91.5%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= c -3.8e+131) (and (not (<= c -5e-51)) (<= c 1.05e+263))) (* (+ (* x y) (* z t)) 2.0) (* (* a (* c i)) -2.0)))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((c <= -3.8e+131) || (!(c <= -5e-51) && (c <= 1.05e+263))) {
tmp = ((x * y) + (z * t)) * 2.0;
} else {
tmp = (a * (c * i)) * -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 <= (-3.8d+131)) .or. (.not. (c <= (-5d-51))) .and. (c <= 1.05d+263)) then
tmp = ((x * y) + (z * t)) * 2.0d0
else
tmp = (a * (c * i)) * (-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 <= -3.8e+131) || (!(c <= -5e-51) && (c <= 1.05e+263))) {
tmp = ((x * y) + (z * t)) * 2.0;
} else {
tmp = (a * (c * i)) * -2.0;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if (c <= -3.8e+131) or (not (c <= -5e-51) and (c <= 1.05e+263)): tmp = ((x * y) + (z * t)) * 2.0 else: tmp = (a * (c * i)) * -2.0 return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if ((c <= -3.8e+131) || (!(c <= -5e-51) && (c <= 1.05e+263))) tmp = Float64(Float64(Float64(x * y) + Float64(z * t)) * 2.0); else tmp = Float64(Float64(a * Float64(c * i)) * -2.0); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if ((c <= -3.8e+131) || (~((c <= -5e-51)) && (c <= 1.05e+263))) tmp = ((x * y) + (z * t)) * 2.0; else tmp = (a * (c * i)) * -2.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[c, -3.8e+131], And[N[Not[LessEqual[c, -5e-51]], $MachinePrecision], LessEqual[c, 1.05e+263]]], N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision], N[(N[(a * N[(c * i), $MachinePrecision]), $MachinePrecision] * -2.0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;c \leq -3.8 \cdot 10^{+131} \lor \neg \left(c \leq -5 \cdot 10^{-51}\right) \land c \leq 1.05 \cdot 10^{+263}:\\
\;\;\;\;\left(x \cdot y + z \cdot t\right) \cdot 2\\
\mathbf{else}:\\
\;\;\;\;\left(a \cdot \left(c \cdot i\right)\right) \cdot -2\\
\end{array}
\end{array}
if c < -3.8000000000000004e131 or -5.00000000000000004e-51 < c < 1.0500000000000001e263Initial program 94.6%
Taylor expanded in c around 0 63.4%
if -3.8000000000000004e131 < c < -5.00000000000000004e-51 or 1.0500000000000001e263 < c Initial program 82.7%
Taylor expanded in a around inf 53.0%
mul-1-neg53.0%
*-commutative53.0%
distribute-rgt-neg-in53.0%
Simplified53.0%
Taylor expanded in c around 0 53.0%
Final simplification61.8%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= z -4.4e+40) (not (<= z 3.4e-129))) (* (+ (* x y) (* z t)) 2.0) (* 2.0 (- (* x y) (* a (* c i))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((z <= -4.4e+40) || !(z <= 3.4e-129)) {
tmp = ((x * y) + (z * t)) * 2.0;
} else {
tmp = 2.0 * ((x * y) - (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 ((z <= (-4.4d+40)) .or. (.not. (z <= 3.4d-129))) then
tmp = ((x * y) + (z * t)) * 2.0d0
else
tmp = 2.0d0 * ((x * y) - (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 ((z <= -4.4e+40) || !(z <= 3.4e-129)) {
tmp = ((x * y) + (z * t)) * 2.0;
} else {
tmp = 2.0 * ((x * y) - (a * (c * i)));
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if (z <= -4.4e+40) or not (z <= 3.4e-129): tmp = ((x * y) + (z * t)) * 2.0 else: tmp = 2.0 * ((x * y) - (a * (c * i))) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if ((z <= -4.4e+40) || !(z <= 3.4e-129)) tmp = Float64(Float64(Float64(x * y) + Float64(z * t)) * 2.0); else tmp = Float64(2.0 * Float64(Float64(x * y) - 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 ((z <= -4.4e+40) || ~((z <= 3.4e-129))) tmp = ((x * y) + (z * t)) * 2.0; else tmp = 2.0 * ((x * y) - (a * (c * i))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[z, -4.4e+40], N[Not[LessEqual[z, 3.4e-129]], $MachinePrecision]], N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision], N[(2.0 * N[(N[(x * y), $MachinePrecision] - N[(a * N[(c * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -4.4 \cdot 10^{+40} \lor \neg \left(z \leq 3.4 \cdot 10^{-129}\right):\\
\;\;\;\;\left(x \cdot y + z \cdot t\right) \cdot 2\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(x \cdot y - a \cdot \left(c \cdot i\right)\right)\\
\end{array}
\end{array}
if z < -4.3999999999999998e40 or 3.40000000000000013e-129 < z Initial program 90.6%
Taylor expanded in c around 0 67.6%
if -4.3999999999999998e40 < z < 3.40000000000000013e-129Initial program 95.2%
Taylor expanded in a around inf 70.6%
*-commutative70.6%
Simplified70.6%
Taylor expanded in z around 0 58.8%
Final simplification63.5%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= y -1.62e-130) (not (<= y 7.8e-70))) (* (+ (* x y) (* z t)) 2.0) (* 2.0 (- (* 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 ((y <= -1.62e-130) || !(y <= 7.8e-70)) {
tmp = ((x * y) + (z * t)) * 2.0;
} else {
tmp = 2.0 * ((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 ((y <= (-1.62d-130)) .or. (.not. (y <= 7.8d-70))) then
tmp = ((x * y) + (z * t)) * 2.0d0
else
tmp = 2.0d0 * ((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 ((y <= -1.62e-130) || !(y <= 7.8e-70)) {
tmp = ((x * y) + (z * t)) * 2.0;
} else {
tmp = 2.0 * ((z * t) - (a * (c * i)));
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if (y <= -1.62e-130) or not (y <= 7.8e-70): tmp = ((x * y) + (z * t)) * 2.0 else: tmp = 2.0 * ((z * t) - (a * (c * i))) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if ((y <= -1.62e-130) || !(y <= 7.8e-70)) tmp = Float64(Float64(Float64(x * y) + Float64(z * t)) * 2.0); else tmp = Float64(2.0 * Float64(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 ((y <= -1.62e-130) || ~((y <= 7.8e-70))) tmp = ((x * y) + (z * t)) * 2.0; else tmp = 2.0 * ((z * t) - (a * (c * i))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[y, -1.62e-130], N[Not[LessEqual[y, 7.8e-70]], $MachinePrecision]], N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision], N[(2.0 * N[(N[(z * t), $MachinePrecision] - N[(a * N[(c * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.62 \cdot 10^{-130} \lor \neg \left(y \leq 7.8 \cdot 10^{-70}\right):\\
\;\;\;\;\left(x \cdot y + z \cdot t\right) \cdot 2\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(z \cdot t - a \cdot \left(c \cdot i\right)\right)\\
\end{array}
\end{array}
if y < -1.62e-130 or 7.80000000000000038e-70 < y Initial program 92.2%
Taylor expanded in c around 0 64.7%
if -1.62e-130 < y < 7.80000000000000038e-70Initial program 93.8%
Taylor expanded in a around inf 66.7%
*-commutative66.7%
Simplified66.7%
Taylor expanded in x around 0 61.6%
Final simplification63.6%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= t -8e+35) (not (<= t 1.5e+129))) (* 2.0 (* z t)) (* (* x y) 2.0)))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((t <= -8e+35) || !(t <= 1.5e+129)) {
tmp = 2.0 * (z * t);
} else {
tmp = (x * y) * 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 ((t <= (-8d+35)) .or. (.not. (t <= 1.5d+129))) then
tmp = 2.0d0 * (z * t)
else
tmp = (x * y) * 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 ((t <= -8e+35) || !(t <= 1.5e+129)) {
tmp = 2.0 * (z * t);
} else {
tmp = (x * y) * 2.0;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if (t <= -8e+35) or not (t <= 1.5e+129): tmp = 2.0 * (z * t) else: tmp = (x * y) * 2.0 return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if ((t <= -8e+35) || !(t <= 1.5e+129)) tmp = Float64(2.0 * Float64(z * t)); else tmp = Float64(Float64(x * y) * 2.0); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if ((t <= -8e+35) || ~((t <= 1.5e+129))) tmp = 2.0 * (z * t); else tmp = (x * y) * 2.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[t, -8e+35], N[Not[LessEqual[t, 1.5e+129]], $MachinePrecision]], N[(2.0 * N[(z * t), $MachinePrecision]), $MachinePrecision], N[(N[(x * y), $MachinePrecision] * 2.0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -8 \cdot 10^{+35} \lor \neg \left(t \leq 1.5 \cdot 10^{+129}\right):\\
\;\;\;\;2 \cdot \left(z \cdot t\right)\\
\mathbf{else}:\\
\;\;\;\;\left(x \cdot y\right) \cdot 2\\
\end{array}
\end{array}
if t < -7.9999999999999997e35 or 1.50000000000000015e129 < t Initial program 92.9%
Taylor expanded in z around inf 51.9%
if -7.9999999999999997e35 < t < 1.50000000000000015e129Initial program 92.7%
Taylor expanded in x around inf 37.2%
Final simplification43.6%
(FPCore (x y z t a b c i) :precision binary64 (* 2.0 (* z t)))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return 2.0 * (z * t);
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
code = 2.0d0 * (z * t)
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return 2.0 * (z * t);
}
def code(x, y, z, t, a, b, c, i): return 2.0 * (z * t)
function code(x, y, z, t, a, b, c, i) return Float64(2.0 * Float64(z * t)) end
function tmp = code(x, y, z, t, a, b, c, i) tmp = 2.0 * (z * t); end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(2.0 * N[(z * t), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
2 \cdot \left(z \cdot t\right)
\end{array}
Initial program 92.8%
Taylor expanded in z around inf 30.2%
Final simplification30.2%
(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 2024107
(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))))