
(FPCore (x y z t a b c i) :precision binary64 (* 2.0 (- (+ (* x y) (* z t)) (* (* (+ a (* b c)) c) i))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return 2.0 * (((x * y) + (z * t)) - (((a + (b * c)) * c) * i));
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
code = 2.0d0 * (((x * y) + (z * t)) - (((a + (b * c)) * c) * i))
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return 2.0 * (((x * y) + (z * t)) - (((a + (b * c)) * c) * i));
}
def code(x, y, z, t, a, b, c, i): return 2.0 * (((x * y) + (z * t)) - (((a + (b * c)) * c) * i))
function code(x, y, z, t, a, b, c, i) return Float64(2.0 * Float64(Float64(Float64(x * y) + Float64(z * t)) - Float64(Float64(Float64(a + Float64(b * c)) * c) * i))) end
function tmp = code(x, y, z, t, a, b, c, i) tmp = 2.0 * (((x * y) + (z * t)) - (((a + (b * c)) * c) * i)); end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(2.0 * N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] - N[(N[(N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision] * c), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
2 \cdot \left(\left(x \cdot y + z \cdot t\right) - \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i\right)
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 14 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a b c i) :precision binary64 (* 2.0 (- (+ (* x y) (* z t)) (* (* (+ a (* b c)) c) i))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return 2.0 * (((x * y) + (z * t)) - (((a + (b * c)) * c) * i));
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
code = 2.0d0 * (((x * y) + (z * t)) - (((a + (b * c)) * c) * i))
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return 2.0 * (((x * y) + (z * t)) - (((a + (b * c)) * c) * i));
}
def code(x, y, z, t, a, b, c, i): return 2.0 * (((x * y) + (z * t)) - (((a + (b * c)) * c) * i))
function code(x, y, z, t, a, b, c, i) return Float64(2.0 * Float64(Float64(Float64(x * y) + Float64(z * t)) - Float64(Float64(Float64(a + Float64(b * c)) * c) * i))) end
function tmp = code(x, y, z, t, a, b, c, i) tmp = 2.0 * (((x * y) + (z * t)) - (((a + (b * c)) * c) * i)); end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(2.0 * N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] - N[(N[(N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision] * c), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
2 \cdot \left(\left(x \cdot y + z \cdot t\right) - \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i\right)
\end{array}
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ a (* b c))) (t_2 (* c (* t_1 i))) (t_3 (* i (* c t_1))))
(if (<= t_3 (- INFINITY))
(* -2.0 t_2)
(if (<= t_3 1e+242)
(* 2.0 (- (+ (* z t) (* x y)) t_3))
(* 2.0 (- (* z t) t_2))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = a + (b * c);
double t_2 = c * (t_1 * i);
double t_3 = i * (c * t_1);
double tmp;
if (t_3 <= -((double) INFINITY)) {
tmp = -2.0 * t_2;
} else if (t_3 <= 1e+242) {
tmp = 2.0 * (((z * t) + (x * y)) - t_3);
} else {
tmp = 2.0 * ((z * t) - t_2);
}
return tmp;
}
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = a + (b * c);
double t_2 = c * (t_1 * i);
double t_3 = i * (c * t_1);
double tmp;
if (t_3 <= -Double.POSITIVE_INFINITY) {
tmp = -2.0 * t_2;
} else if (t_3 <= 1e+242) {
tmp = 2.0 * (((z * t) + (x * y)) - t_3);
} else {
tmp = 2.0 * ((z * t) - t_2);
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = a + (b * c) t_2 = c * (t_1 * i) t_3 = i * (c * t_1) tmp = 0 if t_3 <= -math.inf: tmp = -2.0 * t_2 elif t_3 <= 1e+242: tmp = 2.0 * (((z * t) + (x * y)) - t_3) else: tmp = 2.0 * ((z * t) - t_2) return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(a + Float64(b * c)) t_2 = Float64(c * Float64(t_1 * i)) t_3 = Float64(i * Float64(c * t_1)) tmp = 0.0 if (t_3 <= Float64(-Inf)) tmp = Float64(-2.0 * t_2); elseif (t_3 <= 1e+242) tmp = Float64(2.0 * Float64(Float64(Float64(z * t) + Float64(x * y)) - t_3)); else tmp = Float64(2.0 * Float64(Float64(z * t) - t_2)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = a + (b * c); t_2 = c * (t_1 * i); t_3 = i * (c * t_1); tmp = 0.0; if (t_3 <= -Inf) tmp = -2.0 * t_2; elseif (t_3 <= 1e+242) tmp = 2.0 * (((z * t) + (x * y)) - t_3); else tmp = 2.0 * ((z * t) - t_2); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(c * N[(t$95$1 * i), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(i * N[(c * t$95$1), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$3, (-Infinity)], N[(-2.0 * t$95$2), $MachinePrecision], If[LessEqual[t$95$3, 1e+242], N[(2.0 * N[(N[(N[(z * t), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision] - t$95$3), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[(z * t), $MachinePrecision] - t$95$2), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a + b \cdot c\\
t_2 := c \cdot \left(t_1 \cdot i\right)\\
t_3 := i \cdot \left(c \cdot t_1\right)\\
\mathbf{if}\;t_3 \leq -\infty:\\
\;\;\;\;-2 \cdot t_2\\
\mathbf{elif}\;t_3 \leq 10^{+242}:\\
\;\;\;\;2 \cdot \left(\left(z \cdot t + x \cdot y\right) - t_3\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(z \cdot t - t_2\right)\\
\end{array}
\end{array}
if (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < -inf.0Initial program 76.0%
Taylor expanded in z around 0 87.9%
Taylor expanded in y around 0 88.2%
if -inf.0 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 1.00000000000000005e242Initial program 98.4%
if 1.00000000000000005e242 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) Initial program 80.7%
Taylor expanded in x around 0 96.3%
Final simplification96.3%
(FPCore (x y z t a b c i) :precision binary64 (* 2.0 (- (fma x y (* z t)) (* (+ a (* b c)) (* c i)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return 2.0 * (fma(x, y, (z * t)) - ((a + (b * c)) * (c * i)));
}
function code(x, y, z, t, a, b, c, i) return Float64(2.0 * Float64(fma(x, y, Float64(z * t)) - Float64(Float64(a + Float64(b * c)) * Float64(c * i)))) end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(2.0 * N[(N[(x * y + N[(z * t), $MachinePrecision]), $MachinePrecision] - N[(N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision] * N[(c * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
2 \cdot \left(\mathsf{fma}\left(x, y, z \cdot t\right) - \left(a + b \cdot c\right) \cdot \left(c \cdot i\right)\right)
\end{array}
Initial program 91.0%
associate-*l*95.3%
fma-def95.7%
Simplified95.7%
Final simplification95.7%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* 2.0 (* z t))) (t_2 (* 2.0 (* x y))))
(if (<= x -1.5e+149)
t_2
(if (<= x -1.05e+136)
(* -2.0 (* c (* a i)))
(if (<= x -7.5e+102)
t_2
(if (<= x -9e+66)
t_1
(if (<= x -1.8e+40)
t_2
(if (<= x -0.000185)
(* (* a c) (* i -2.0))
(if (<= x 3.5e-264)
t_1
(if (<= x 9.6e-231)
(* 2.0 (* (* c i) (- a)))
(if (<= x 4.5e-84) t_1 t_2)))))))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = 2.0 * (z * t);
double t_2 = 2.0 * (x * y);
double tmp;
if (x <= -1.5e+149) {
tmp = t_2;
} else if (x <= -1.05e+136) {
tmp = -2.0 * (c * (a * i));
} else if (x <= -7.5e+102) {
tmp = t_2;
} else if (x <= -9e+66) {
tmp = t_1;
} else if (x <= -1.8e+40) {
tmp = t_2;
} else if (x <= -0.000185) {
tmp = (a * c) * (i * -2.0);
} else if (x <= 3.5e-264) {
tmp = t_1;
} else if (x <= 9.6e-231) {
tmp = 2.0 * ((c * i) * -a);
} else if (x <= 4.5e-84) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = 2.0d0 * (z * t)
t_2 = 2.0d0 * (x * y)
if (x <= (-1.5d+149)) then
tmp = t_2
else if (x <= (-1.05d+136)) then
tmp = (-2.0d0) * (c * (a * i))
else if (x <= (-7.5d+102)) then
tmp = t_2
else if (x <= (-9d+66)) then
tmp = t_1
else if (x <= (-1.8d+40)) then
tmp = t_2
else if (x <= (-0.000185d0)) then
tmp = (a * c) * (i * (-2.0d0))
else if (x <= 3.5d-264) then
tmp = t_1
else if (x <= 9.6d-231) then
tmp = 2.0d0 * ((c * i) * -a)
else if (x <= 4.5d-84) then
tmp = t_1
else
tmp = t_2
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = 2.0 * (z * t);
double t_2 = 2.0 * (x * y);
double tmp;
if (x <= -1.5e+149) {
tmp = t_2;
} else if (x <= -1.05e+136) {
tmp = -2.0 * (c * (a * i));
} else if (x <= -7.5e+102) {
tmp = t_2;
} else if (x <= -9e+66) {
tmp = t_1;
} else if (x <= -1.8e+40) {
tmp = t_2;
} else if (x <= -0.000185) {
tmp = (a * c) * (i * -2.0);
} else if (x <= 3.5e-264) {
tmp = t_1;
} else if (x <= 9.6e-231) {
tmp = 2.0 * ((c * i) * -a);
} else if (x <= 4.5e-84) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = 2.0 * (z * t) t_2 = 2.0 * (x * y) tmp = 0 if x <= -1.5e+149: tmp = t_2 elif x <= -1.05e+136: tmp = -2.0 * (c * (a * i)) elif x <= -7.5e+102: tmp = t_2 elif x <= -9e+66: tmp = t_1 elif x <= -1.8e+40: tmp = t_2 elif x <= -0.000185: tmp = (a * c) * (i * -2.0) elif x <= 3.5e-264: tmp = t_1 elif x <= 9.6e-231: tmp = 2.0 * ((c * i) * -a) elif x <= 4.5e-84: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(2.0 * Float64(z * t)) t_2 = Float64(2.0 * Float64(x * y)) tmp = 0.0 if (x <= -1.5e+149) tmp = t_2; elseif (x <= -1.05e+136) tmp = Float64(-2.0 * Float64(c * Float64(a * i))); elseif (x <= -7.5e+102) tmp = t_2; elseif (x <= -9e+66) tmp = t_1; elseif (x <= -1.8e+40) tmp = t_2; elseif (x <= -0.000185) tmp = Float64(Float64(a * c) * Float64(i * -2.0)); elseif (x <= 3.5e-264) tmp = t_1; elseif (x <= 9.6e-231) tmp = Float64(2.0 * Float64(Float64(c * i) * Float64(-a))); elseif (x <= 4.5e-84) tmp = t_1; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = 2.0 * (z * t); t_2 = 2.0 * (x * y); tmp = 0.0; if (x <= -1.5e+149) tmp = t_2; elseif (x <= -1.05e+136) tmp = -2.0 * (c * (a * i)); elseif (x <= -7.5e+102) tmp = t_2; elseif (x <= -9e+66) tmp = t_1; elseif (x <= -1.8e+40) tmp = t_2; elseif (x <= -0.000185) tmp = (a * c) * (i * -2.0); elseif (x <= 3.5e-264) tmp = t_1; elseif (x <= 9.6e-231) tmp = 2.0 * ((c * i) * -a); elseif (x <= 4.5e-84) tmp = t_1; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(2.0 * N[(z * t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(2.0 * N[(x * y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -1.5e+149], t$95$2, If[LessEqual[x, -1.05e+136], N[(-2.0 * N[(c * N[(a * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -7.5e+102], t$95$2, If[LessEqual[x, -9e+66], t$95$1, If[LessEqual[x, -1.8e+40], t$95$2, If[LessEqual[x, -0.000185], N[(N[(a * c), $MachinePrecision] * N[(i * -2.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 3.5e-264], t$95$1, If[LessEqual[x, 9.6e-231], N[(2.0 * N[(N[(c * i), $MachinePrecision] * (-a)), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 4.5e-84], t$95$1, t$95$2]]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := 2 \cdot \left(z \cdot t\right)\\
t_2 := 2 \cdot \left(x \cdot y\right)\\
\mathbf{if}\;x \leq -1.5 \cdot 10^{+149}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;x \leq -1.05 \cdot 10^{+136}:\\
\;\;\;\;-2 \cdot \left(c \cdot \left(a \cdot i\right)\right)\\
\mathbf{elif}\;x \leq -7.5 \cdot 10^{+102}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;x \leq -9 \cdot 10^{+66}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq -1.8 \cdot 10^{+40}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;x \leq -0.000185:\\
\;\;\;\;\left(a \cdot c\right) \cdot \left(i \cdot -2\right)\\
\mathbf{elif}\;x \leq 3.5 \cdot 10^{-264}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq 9.6 \cdot 10^{-231}:\\
\;\;\;\;2 \cdot \left(\left(c \cdot i\right) \cdot \left(-a\right)\right)\\
\mathbf{elif}\;x \leq 4.5 \cdot 10^{-84}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if x < -1.50000000000000002e149 or -1.05e136 < x < -7.5e102 or -8.9999999999999997e66 < x < -1.79999999999999998e40 or 4.50000000000000016e-84 < x Initial program 89.9%
Taylor expanded in x around inf 52.3%
if -1.50000000000000002e149 < x < -1.05e136Initial program 88.2%
Taylor expanded in z around 0 64.6%
Taylor expanded in a around inf 63.4%
if -7.5e102 < x < -8.9999999999999997e66 or -1.85e-4 < x < 3.5e-264 or 9.59999999999999967e-231 < x < 4.50000000000000016e-84Initial program 91.3%
Taylor expanded in z around inf 44.9%
if -1.79999999999999998e40 < x < -1.85e-4Initial program 100.0%
Taylor expanded in z around 0 69.7%
Taylor expanded in a around inf 20.7%
*-commutative20.7%
*-commutative20.7%
associate-*r*51.2%
associate-*l*51.2%
Simplified51.2%
if 3.5e-264 < x < 9.59999999999999967e-231Initial program 100.0%
associate-*l*100.0%
fma-def100.0%
Simplified100.0%
fma-def100.0%
+-commutative100.0%
Applied egg-rr100.0%
Taylor expanded in a around inf 16.1%
mul-1-neg16.1%
associate-*r*16.0%
*-commutative16.0%
distribute-rgt-neg-in16.0%
distribute-rgt-neg-in16.0%
Simplified16.0%
Final simplification48.5%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* c (* (+ a (* b c)) i))))
(if (or (<= x -1.12e+85) (not (<= x 2.2e-146)))
(* 2.0 (- (* x y) t_1))
(* 2.0 (- (* z t) t_1)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = c * ((a + (b * c)) * i);
double tmp;
if ((x <= -1.12e+85) || !(x <= 2.2e-146)) {
tmp = 2.0 * ((x * y) - t_1);
} else {
tmp = 2.0 * ((z * t) - t_1);
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: t_1
real(8) :: tmp
t_1 = c * ((a + (b * c)) * i)
if ((x <= (-1.12d+85)) .or. (.not. (x <= 2.2d-146))) then
tmp = 2.0d0 * ((x * y) - t_1)
else
tmp = 2.0d0 * ((z * t) - t_1)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = c * ((a + (b * c)) * i);
double tmp;
if ((x <= -1.12e+85) || !(x <= 2.2e-146)) {
tmp = 2.0 * ((x * y) - t_1);
} else {
tmp = 2.0 * ((z * t) - t_1);
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = c * ((a + (b * c)) * i) tmp = 0 if (x <= -1.12e+85) or not (x <= 2.2e-146): tmp = 2.0 * ((x * y) - t_1) else: tmp = 2.0 * ((z * t) - t_1) return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(c * Float64(Float64(a + Float64(b * c)) * i)) tmp = 0.0 if ((x <= -1.12e+85) || !(x <= 2.2e-146)) tmp = Float64(2.0 * Float64(Float64(x * y) - t_1)); else tmp = Float64(2.0 * Float64(Float64(z * t) - t_1)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = c * ((a + (b * c)) * i); tmp = 0.0; if ((x <= -1.12e+85) || ~((x <= 2.2e-146))) tmp = 2.0 * ((x * y) - t_1); else tmp = 2.0 * ((z * t) - t_1); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(c * N[(N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[x, -1.12e+85], N[Not[LessEqual[x, 2.2e-146]], $MachinePrecision]], N[(2.0 * N[(N[(x * y), $MachinePrecision] - t$95$1), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[(z * t), $MachinePrecision] - t$95$1), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := c \cdot \left(\left(a + b \cdot c\right) \cdot i\right)\\
\mathbf{if}\;x \leq -1.12 \cdot 10^{+85} \lor \neg \left(x \leq 2.2 \cdot 10^{-146}\right):\\
\;\;\;\;2 \cdot \left(x \cdot y - t_1\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(z \cdot t - t_1\right)\\
\end{array}
\end{array}
if x < -1.11999999999999993e85 or 2.2e-146 < x Initial program 89.9%
Taylor expanded in z around 0 78.5%
if -1.11999999999999993e85 < x < 2.2e-146Initial program 92.3%
Taylor expanded in x around 0 80.8%
Final simplification79.6%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= c -6e+79) (not (<= c 5.2e+99))) (* 2.0 (- (* z t) (* c (* (+ a (* b c)) i)))) (* 2.0 (- (+ (* z t) (* x y)) (* 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 <= -6e+79) || !(c <= 5.2e+99)) {
tmp = 2.0 * ((z * t) - (c * ((a + (b * c)) * i)));
} else {
tmp = 2.0 * (((z * t) + (x * y)) - (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 <= (-6d+79)) .or. (.not. (c <= 5.2d+99))) then
tmp = 2.0d0 * ((z * t) - (c * ((a + (b * c)) * i)))
else
tmp = 2.0d0 * (((z * t) + (x * y)) - (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 <= -6e+79) || !(c <= 5.2e+99)) {
tmp = 2.0 * ((z * t) - (c * ((a + (b * c)) * i)));
} else {
tmp = 2.0 * (((z * t) + (x * y)) - (i * (a * c)));
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if (c <= -6e+79) or not (c <= 5.2e+99): tmp = 2.0 * ((z * t) - (c * ((a + (b * c)) * i))) else: tmp = 2.0 * (((z * t) + (x * y)) - (i * (a * c))) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if ((c <= -6e+79) || !(c <= 5.2e+99)) 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(z * t) + Float64(x * y)) - 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 <= -6e+79) || ~((c <= 5.2e+99))) tmp = 2.0 * ((z * t) - (c * ((a + (b * c)) * i))); else tmp = 2.0 * (((z * t) + (x * y)) - (i * (a * c))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[c, -6e+79], N[Not[LessEqual[c, 5.2e+99]], $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[(z * t), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision] - N[(i * N[(a * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;c \leq -6 \cdot 10^{+79} \lor \neg \left(c \leq 5.2 \cdot 10^{+99}\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(z \cdot t + x \cdot y\right) - i \cdot \left(a \cdot c\right)\right)\\
\end{array}
\end{array}
if c < -5.99999999999999948e79 or 5.1999999999999999e99 < c Initial program 81.1%
Taylor expanded in x around 0 88.0%
if -5.99999999999999948e79 < c < 5.1999999999999999e99Initial program 97.1%
Taylor expanded in a around inf 90.8%
Final simplification89.7%
(FPCore (x y z t a b c i)
:precision binary64
(if (<= x -3e+103)
(* 2.0 (- (* x y) (* c (* a i))))
(if (<= x 4.5e-84)
(* 2.0 (- (* z t) (* c (* (+ a (* b c)) i))))
(* 2.0 (- (* x y) (* c (* c (* b i))))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (x <= -3e+103) {
tmp = 2.0 * ((x * y) - (c * (a * i)));
} else if (x <= 4.5e-84) {
tmp = 2.0 * ((z * t) - (c * ((a + (b * c)) * i)));
} else {
tmp = 2.0 * ((x * y) - (c * (c * (b * 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 (x <= (-3d+103)) then
tmp = 2.0d0 * ((x * y) - (c * (a * i)))
else if (x <= 4.5d-84) then
tmp = 2.0d0 * ((z * t) - (c * ((a + (b * c)) * i)))
else
tmp = 2.0d0 * ((x * y) - (c * (c * (b * 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 (x <= -3e+103) {
tmp = 2.0 * ((x * y) - (c * (a * i)));
} else if (x <= 4.5e-84) {
tmp = 2.0 * ((z * t) - (c * ((a + (b * c)) * i)));
} else {
tmp = 2.0 * ((x * y) - (c * (c * (b * i))));
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if x <= -3e+103: tmp = 2.0 * ((x * y) - (c * (a * i))) elif x <= 4.5e-84: tmp = 2.0 * ((z * t) - (c * ((a + (b * c)) * i))) else: tmp = 2.0 * ((x * y) - (c * (c * (b * i)))) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (x <= -3e+103) tmp = Float64(2.0 * Float64(Float64(x * y) - Float64(c * Float64(a * i)))); elseif (x <= 4.5e-84) tmp = Float64(2.0 * Float64(Float64(z * t) - Float64(c * Float64(Float64(a + Float64(b * c)) * i)))); else tmp = Float64(2.0 * Float64(Float64(x * y) - Float64(c * Float64(c * Float64(b * i))))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if (x <= -3e+103) tmp = 2.0 * ((x * y) - (c * (a * i))); elseif (x <= 4.5e-84) tmp = 2.0 * ((z * t) - (c * ((a + (b * c)) * i))); else tmp = 2.0 * ((x * y) - (c * (c * (b * i)))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[x, -3e+103], N[(2.0 * N[(N[(x * y), $MachinePrecision] - N[(c * N[(a * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 4.5e-84], N[(2.0 * N[(N[(z * t), $MachinePrecision] - N[(c * N[(N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[(x * y), $MachinePrecision] - N[(c * N[(c * N[(b * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -3 \cdot 10^{+103}:\\
\;\;\;\;2 \cdot \left(x \cdot y - c \cdot \left(a \cdot i\right)\right)\\
\mathbf{elif}\;x \leq 4.5 \cdot 10^{-84}:\\
\;\;\;\;2 \cdot \left(z \cdot t - c \cdot \left(\left(a + b \cdot c\right) \cdot i\right)\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(x \cdot y - c \cdot \left(c \cdot \left(b \cdot i\right)\right)\right)\\
\end{array}
\end{array}
if x < -3e103Initial program 91.9%
Taylor expanded in z around 0 81.1%
Taylor expanded in c around 0 75.0%
*-commutative75.0%
Simplified75.0%
if -3e103 < x < 4.50000000000000016e-84Initial program 92.0%
Taylor expanded in x around 0 81.4%
if 4.50000000000000016e-84 < x Initial program 88.7%
Taylor expanded in z around 0 76.8%
Taylor expanded in c around inf 64.0%
Final simplification74.8%
(FPCore (x y z t a b c i) :precision binary64 (* 2.0 (- (+ (* z t) (* x y)) (* (+ 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 * (((z * t) + (x * y)) - ((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 * (((z * t) + (x * y)) - ((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 * (((z * t) + (x * y)) - ((a + (b * c)) * (c * i)));
}
def code(x, y, z, t, a, b, c, i): return 2.0 * (((z * t) + (x * y)) - ((a + (b * c)) * (c * i)))
function code(x, y, z, t, a, b, c, i) return Float64(2.0 * Float64(Float64(Float64(z * t) + Float64(x * y)) - Float64(Float64(a + Float64(b * c)) * Float64(c * i)))) end
function tmp = code(x, y, z, t, a, b, c, i) tmp = 2.0 * (((z * t) + (x * y)) - ((a + (b * c)) * (c * i))); end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(2.0 * N[(N[(N[(z * t), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision] - N[(N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision] * N[(c * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
2 \cdot \left(\left(z \cdot t + x \cdot y\right) - \left(a + b \cdot c\right) \cdot \left(c \cdot i\right)\right)
\end{array}
Initial program 91.0%
associate-*l*95.3%
fma-def95.7%
Simplified95.7%
fma-def95.3%
+-commutative95.3%
Applied egg-rr95.3%
Final simplification95.3%
(FPCore (x y z t a b c i)
:precision binary64
(if (<= x -2.3e+40)
(* 2.0 (+ (* z t) (* x y)))
(if (<= x 1.02e-135)
(* 2.0 (- (* z t) (* b (* c (* c i)))))
(* 2.0 (- (* x y) (* i (* a c)))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (x <= -2.3e+40) {
tmp = 2.0 * ((z * t) + (x * y));
} else if (x <= 1.02e-135) {
tmp = 2.0 * ((z * t) - (b * (c * (c * i))));
} else {
tmp = 2.0 * ((x * y) - (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 (x <= (-2.3d+40)) then
tmp = 2.0d0 * ((z * t) + (x * y))
else if (x <= 1.02d-135) then
tmp = 2.0d0 * ((z * t) - (b * (c * (c * i))))
else
tmp = 2.0d0 * ((x * y) - (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 (x <= -2.3e+40) {
tmp = 2.0 * ((z * t) + (x * y));
} else if (x <= 1.02e-135) {
tmp = 2.0 * ((z * t) - (b * (c * (c * i))));
} else {
tmp = 2.0 * ((x * y) - (i * (a * c)));
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if x <= -2.3e+40: tmp = 2.0 * ((z * t) + (x * y)) elif x <= 1.02e-135: tmp = 2.0 * ((z * t) - (b * (c * (c * i)))) else: tmp = 2.0 * ((x * y) - (i * (a * c))) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (x <= -2.3e+40) tmp = Float64(2.0 * Float64(Float64(z * t) + Float64(x * y))); elseif (x <= 1.02e-135) tmp = Float64(2.0 * Float64(Float64(z * t) - Float64(b * Float64(c * Float64(c * i))))); else tmp = Float64(2.0 * Float64(Float64(x * y) - 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 (x <= -2.3e+40) tmp = 2.0 * ((z * t) + (x * y)); elseif (x <= 1.02e-135) tmp = 2.0 * ((z * t) - (b * (c * (c * i)))); else tmp = 2.0 * ((x * y) - (i * (a * c))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[x, -2.3e+40], N[(2.0 * N[(N[(z * t), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 1.02e-135], N[(2.0 * N[(N[(z * t), $MachinePrecision] - N[(b * N[(c * N[(c * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[(x * y), $MachinePrecision] - N[(i * N[(a * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.3 \cdot 10^{+40}:\\
\;\;\;\;2 \cdot \left(z \cdot t + x \cdot y\right)\\
\mathbf{elif}\;x \leq 1.02 \cdot 10^{-135}:\\
\;\;\;\;2 \cdot \left(z \cdot t - b \cdot \left(c \cdot \left(c \cdot i\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(x \cdot y - i \cdot \left(a \cdot c\right)\right)\\
\end{array}
\end{array}
if x < -2.29999999999999994e40Initial program 90.0%
Taylor expanded in c around 0 71.8%
if -2.29999999999999994e40 < x < 1.01999999999999994e-135Initial program 93.5%
Taylor expanded in a around 0 77.9%
unpow277.9%
associate-*r*83.4%
Simplified83.4%
Taylor expanded in x around 0 70.4%
unpow270.4%
associate-*r*71.5%
*-commutative71.5%
associate-*l*77.8%
Simplified77.8%
if 1.01999999999999994e-135 < x Initial program 88.6%
Taylor expanded in a around inf 75.7%
Taylor expanded in z around 0 59.2%
associate-*r*57.2%
Simplified57.2%
Final simplification69.4%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= c -9.6e+92) (not (<= c 1.6e+100))) (* -2.0 (* c (* (+ a (* b c)) i))) (* 2.0 (+ (* z t) (* x y)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((c <= -9.6e+92) || !(c <= 1.6e+100)) {
tmp = -2.0 * (c * ((a + (b * c)) * i));
} else {
tmp = 2.0 * ((z * t) + (x * y));
}
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 <= (-9.6d+92)) .or. (.not. (c <= 1.6d+100))) then
tmp = (-2.0d0) * (c * ((a + (b * c)) * i))
else
tmp = 2.0d0 * ((z * t) + (x * y))
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 <= -9.6e+92) || !(c <= 1.6e+100)) {
tmp = -2.0 * (c * ((a + (b * c)) * i));
} else {
tmp = 2.0 * ((z * t) + (x * y));
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if (c <= -9.6e+92) or not (c <= 1.6e+100): tmp = -2.0 * (c * ((a + (b * c)) * i)) else: tmp = 2.0 * ((z * t) + (x * y)) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if ((c <= -9.6e+92) || !(c <= 1.6e+100)) tmp = Float64(-2.0 * Float64(c * Float64(Float64(a + Float64(b * c)) * i))); else tmp = Float64(2.0 * Float64(Float64(z * t) + Float64(x * y))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if ((c <= -9.6e+92) || ~((c <= 1.6e+100))) tmp = -2.0 * (c * ((a + (b * c)) * i)); else tmp = 2.0 * ((z * t) + (x * y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[c, -9.6e+92], N[Not[LessEqual[c, 1.6e+100]], $MachinePrecision]], N[(-2.0 * N[(c * N[(N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[(z * t), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;c \leq -9.6 \cdot 10^{+92} \lor \neg \left(c \leq 1.6 \cdot 10^{+100}\right):\\
\;\;\;\;-2 \cdot \left(c \cdot \left(\left(a + b \cdot c\right) \cdot i\right)\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(z \cdot t + x \cdot y\right)\\
\end{array}
\end{array}
if c < -9.60000000000000018e92 or 1.5999999999999999e100 < c Initial program 81.0%
Taylor expanded in z around 0 87.9%
Taylor expanded in y around 0 84.2%
if -9.60000000000000018e92 < c < 1.5999999999999999e100Initial program 96.6%
Taylor expanded in c around 0 74.4%
Final simplification77.9%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= c -4e+67) (not (<= c 1.15e+107))) (* -2.0 (* (* b i) (* c c))) (* 2.0 (+ (* z t) (* x y)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((c <= -4e+67) || !(c <= 1.15e+107)) {
tmp = -2.0 * ((b * i) * (c * c));
} else {
tmp = 2.0 * ((z * t) + (x * y));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: tmp
if ((c <= (-4d+67)) .or. (.not. (c <= 1.15d+107))) then
tmp = (-2.0d0) * ((b * i) * (c * c))
else
tmp = 2.0d0 * ((z * t) + (x * y))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((c <= -4e+67) || !(c <= 1.15e+107)) {
tmp = -2.0 * ((b * i) * (c * c));
} else {
tmp = 2.0 * ((z * t) + (x * y));
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if (c <= -4e+67) or not (c <= 1.15e+107): tmp = -2.0 * ((b * i) * (c * c)) else: tmp = 2.0 * ((z * t) + (x * y)) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if ((c <= -4e+67) || !(c <= 1.15e+107)) tmp = Float64(-2.0 * Float64(Float64(b * i) * Float64(c * c))); else tmp = Float64(2.0 * Float64(Float64(z * t) + Float64(x * y))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if ((c <= -4e+67) || ~((c <= 1.15e+107))) tmp = -2.0 * ((b * i) * (c * c)); else tmp = 2.0 * ((z * t) + (x * y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[c, -4e+67], N[Not[LessEqual[c, 1.15e+107]], $MachinePrecision]], N[(-2.0 * N[(N[(b * i), $MachinePrecision] * N[(c * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[(z * t), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;c \leq -4 \cdot 10^{+67} \lor \neg \left(c \leq 1.15 \cdot 10^{+107}\right):\\
\;\;\;\;-2 \cdot \left(\left(b \cdot i\right) \cdot \left(c \cdot c\right)\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(z \cdot t + x \cdot y\right)\\
\end{array}
\end{array}
if c < -3.99999999999999993e67 or 1.15e107 < c Initial program 81.3%
Taylor expanded in z around 0 84.8%
Taylor expanded in c around inf 68.7%
*-commutative68.7%
associate-*r*67.0%
associate-*r*68.7%
unpow268.7%
Simplified68.7%
if -3.99999999999999993e67 < c < 1.15e107Initial program 97.0%
Taylor expanded in c around 0 75.1%
Final simplification72.6%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= c -1.95e+138) (not (<= c 4.4e+107))) (* -2.0 (* b (* c (* c i)))) (* 2.0 (+ (* z t) (* x y)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((c <= -1.95e+138) || !(c <= 4.4e+107)) {
tmp = -2.0 * (b * (c * (c * i)));
} else {
tmp = 2.0 * ((z * t) + (x * y));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: tmp
if ((c <= (-1.95d+138)) .or. (.not. (c <= 4.4d+107))) then
tmp = (-2.0d0) * (b * (c * (c * i)))
else
tmp = 2.0d0 * ((z * t) + (x * y))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((c <= -1.95e+138) || !(c <= 4.4e+107)) {
tmp = -2.0 * (b * (c * (c * i)));
} else {
tmp = 2.0 * ((z * t) + (x * y));
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if (c <= -1.95e+138) or not (c <= 4.4e+107): tmp = -2.0 * (b * (c * (c * i))) else: tmp = 2.0 * ((z * t) + (x * y)) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if ((c <= -1.95e+138) || !(c <= 4.4e+107)) tmp = Float64(-2.0 * Float64(b * Float64(c * Float64(c * i)))); else tmp = Float64(2.0 * Float64(Float64(z * t) + Float64(x * y))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if ((c <= -1.95e+138) || ~((c <= 4.4e+107))) tmp = -2.0 * (b * (c * (c * i))); else tmp = 2.0 * ((z * t) + (x * y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[c, -1.95e+138], N[Not[LessEqual[c, 4.4e+107]], $MachinePrecision]], N[(-2.0 * N[(b * N[(c * N[(c * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[(z * t), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;c \leq -1.95 \cdot 10^{+138} \lor \neg \left(c \leq 4.4 \cdot 10^{+107}\right):\\
\;\;\;\;-2 \cdot \left(b \cdot \left(c \cdot \left(c \cdot i\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(z \cdot t + x \cdot y\right)\\
\end{array}
\end{array}
if c < -1.9499999999999999e138 or 4.4e107 < c Initial program 81.8%
Taylor expanded in z around 0 88.6%
Taylor expanded in c around inf 73.3%
*-commutative73.3%
associate-*r*73.6%
unpow273.6%
sqr-neg73.6%
sqr-neg73.6%
associate-*l*77.1%
Simplified77.1%
if -1.9499999999999999e138 < c < 4.4e107Initial program 95.1%
Taylor expanded in c around 0 71.7%
Final simplification73.4%
(FPCore (x y z t a b c i) :precision binary64 (if (<= a -3.8e+175) (* 2.0 (* (* c i) (- a))) (if (<= a 3e+217) (* 2.0 (+ (* z t) (* x y))) (* -2.0 (* c (* a i))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (a <= -3.8e+175) {
tmp = 2.0 * ((c * i) * -a);
} else if (a <= 3e+217) {
tmp = 2.0 * ((z * t) + (x * y));
} else {
tmp = -2.0 * (c * (a * 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 (a <= (-3.8d+175)) then
tmp = 2.0d0 * ((c * i) * -a)
else if (a <= 3d+217) then
tmp = 2.0d0 * ((z * t) + (x * y))
else
tmp = (-2.0d0) * (c * (a * 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 (a <= -3.8e+175) {
tmp = 2.0 * ((c * i) * -a);
} else if (a <= 3e+217) {
tmp = 2.0 * ((z * t) + (x * y));
} else {
tmp = -2.0 * (c * (a * i));
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if a <= -3.8e+175: tmp = 2.0 * ((c * i) * -a) elif a <= 3e+217: tmp = 2.0 * ((z * t) + (x * y)) else: tmp = -2.0 * (c * (a * i)) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (a <= -3.8e+175) tmp = Float64(2.0 * Float64(Float64(c * i) * Float64(-a))); elseif (a <= 3e+217) tmp = Float64(2.0 * Float64(Float64(z * t) + Float64(x * y))); else tmp = Float64(-2.0 * Float64(c * Float64(a * i))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if (a <= -3.8e+175) tmp = 2.0 * ((c * i) * -a); elseif (a <= 3e+217) tmp = 2.0 * ((z * t) + (x * y)); else tmp = -2.0 * (c * (a * i)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[a, -3.8e+175], N[(2.0 * N[(N[(c * i), $MachinePrecision] * (-a)), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 3e+217], N[(2.0 * N[(N[(z * t), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(-2.0 * N[(c * N[(a * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -3.8 \cdot 10^{+175}:\\
\;\;\;\;2 \cdot \left(\left(c \cdot i\right) \cdot \left(-a\right)\right)\\
\mathbf{elif}\;a \leq 3 \cdot 10^{+217}:\\
\;\;\;\;2 \cdot \left(z \cdot t + x \cdot y\right)\\
\mathbf{else}:\\
\;\;\;\;-2 \cdot \left(c \cdot \left(a \cdot i\right)\right)\\
\end{array}
\end{array}
if a < -3.7999999999999997e175Initial program 79.9%
associate-*l*95.7%
fma-def95.7%
Simplified95.7%
fma-def95.7%
+-commutative95.7%
Applied egg-rr95.7%
Taylor expanded in a around inf 55.2%
mul-1-neg55.2%
associate-*r*63.0%
*-commutative63.0%
distribute-rgt-neg-in63.0%
distribute-rgt-neg-in63.0%
Simplified63.0%
if -3.7999999999999997e175 < a < 2.99999999999999976e217Initial program 92.0%
Taylor expanded in c around 0 64.8%
if 2.99999999999999976e217 < a Initial program 92.8%
Taylor expanded in z around 0 92.3%
Taylor expanded in a around inf 66.6%
Final simplification64.8%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= t -3.5e-10) (not (<= t 1.25e+128))) (* 2.0 (* z t)) (* 2.0 (* x y))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((t <= -3.5e-10) || !(t <= 1.25e+128)) {
tmp = 2.0 * (z * t);
} else {
tmp = 2.0 * (x * y);
}
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 <= (-3.5d-10)) .or. (.not. (t <= 1.25d+128))) then
tmp = 2.0d0 * (z * t)
else
tmp = 2.0d0 * (x * y)
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 <= -3.5e-10) || !(t <= 1.25e+128)) {
tmp = 2.0 * (z * t);
} else {
tmp = 2.0 * (x * y);
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if (t <= -3.5e-10) or not (t <= 1.25e+128): tmp = 2.0 * (z * t) else: tmp = 2.0 * (x * y) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if ((t <= -3.5e-10) || !(t <= 1.25e+128)) tmp = Float64(2.0 * Float64(z * t)); else tmp = Float64(2.0 * Float64(x * y)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if ((t <= -3.5e-10) || ~((t <= 1.25e+128))) tmp = 2.0 * (z * t); else tmp = 2.0 * (x * y); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[t, -3.5e-10], N[Not[LessEqual[t, 1.25e+128]], $MachinePrecision]], N[(2.0 * N[(z * t), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(x * y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -3.5 \cdot 10^{-10} \lor \neg \left(t \leq 1.25 \cdot 10^{+128}\right):\\
\;\;\;\;2 \cdot \left(z \cdot t\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(x \cdot y\right)\\
\end{array}
\end{array}
if t < -3.4999999999999998e-10 or 1.25e128 < t Initial program 86.4%
Taylor expanded in z around inf 47.4%
if -3.4999999999999998e-10 < t < 1.25e128Initial program 94.3%
Taylor expanded in x around inf 37.6%
Final simplification41.7%
(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 91.0%
Taylor expanded in z around inf 30.7%
Final simplification30.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 2023229
(FPCore (x y z t a b c i)
:name "Diagrams.ThreeD.Shapes:frustum from diagrams-lib-1.3.0.3, A"
:precision binary64
:herbie-target
(* 2.0 (- (+ (* x y) (* z t)) (* (+ a (* b c)) (* c i))))
(* 2.0 (- (+ (* x y) (* z t)) (* (* (+ a (* b c)) c) i))))