
(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 16 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 (* i (* c t_1))) (t_3 (* c (* t_1 i))))
(if (<= t_2 (- INFINITY))
(* 2.0 (- (* x y) t_3))
(if (<= t_2 5e+303)
(* 2.0 (- (+ (* x y) (* z t)) t_2))
(* 2.0 (- (* z t) t_3))))))
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 = i * (c * t_1);
double t_3 = c * (t_1 * i);
double tmp;
if (t_2 <= -((double) INFINITY)) {
tmp = 2.0 * ((x * y) - t_3);
} else if (t_2 <= 5e+303) {
tmp = 2.0 * (((x * y) + (z * t)) - t_2);
} else {
tmp = 2.0 * ((z * t) - t_3);
}
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 = i * (c * t_1);
double t_3 = c * (t_1 * i);
double tmp;
if (t_2 <= -Double.POSITIVE_INFINITY) {
tmp = 2.0 * ((x * y) - t_3);
} else if (t_2 <= 5e+303) {
tmp = 2.0 * (((x * y) + (z * t)) - t_2);
} else {
tmp = 2.0 * ((z * t) - t_3);
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = a + (b * c) t_2 = i * (c * t_1) t_3 = c * (t_1 * i) tmp = 0 if t_2 <= -math.inf: tmp = 2.0 * ((x * y) - t_3) elif t_2 <= 5e+303: tmp = 2.0 * (((x * y) + (z * t)) - t_2) else: tmp = 2.0 * ((z * t) - t_3) return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(a + Float64(b * c)) t_2 = Float64(i * Float64(c * t_1)) t_3 = Float64(c * Float64(t_1 * i)) tmp = 0.0 if (t_2 <= Float64(-Inf)) tmp = Float64(2.0 * Float64(Float64(x * y) - t_3)); elseif (t_2 <= 5e+303) tmp = Float64(2.0 * Float64(Float64(Float64(x * y) + Float64(z * t)) - t_2)); else tmp = Float64(2.0 * Float64(Float64(z * t) - t_3)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = a + (b * c); t_2 = i * (c * t_1); t_3 = c * (t_1 * i); tmp = 0.0; if (t_2 <= -Inf) tmp = 2.0 * ((x * y) - t_3); elseif (t_2 <= 5e+303) tmp = 2.0 * (((x * y) + (z * t)) - t_2); else tmp = 2.0 * ((z * t) - t_3); 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[(i * N[(c * t$95$1), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(c * N[(t$95$1 * i), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, (-Infinity)], N[(2.0 * N[(N[(x * y), $MachinePrecision] - t$95$3), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, 5e+303], N[(2.0 * N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] - t$95$2), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[(z * t), $MachinePrecision] - t$95$3), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a + b \cdot c\\
t_2 := i \cdot \left(c \cdot t_1\right)\\
t_3 := c \cdot \left(t_1 \cdot i\right)\\
\mathbf{if}\;t_2 \leq -\infty:\\
\;\;\;\;2 \cdot \left(x \cdot y - t_3\right)\\
\mathbf{elif}\;t_2 \leq 5 \cdot 10^{+303}:\\
\;\;\;\;2 \cdot \left(\left(x \cdot y + z \cdot t\right) - t_2\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(z \cdot t - t_3\right)\\
\end{array}
\end{array}
if (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < -inf.0Initial program 65.3%
Taylor expanded in z around 0 88.1%
if -inf.0 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 4.9999999999999997e303Initial program 98.6%
if 4.9999999999999997e303 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) Initial program 78.0%
Taylor expanded in x around 0 91.7%
Final simplification95.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 88.2%
associate-*l*92.7%
fma-def93.4%
Simplified93.4%
Final simplification93.4%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* (* c (* (+ a (* b c)) i)) -2.0)))
(if (<= c -3e+144)
t_1
(if (<= c -8.6e+98)
(* 2.0 (- (* z t) (* c (* a i))))
(if (or (<= c -8e+79)
(not
(or (<= c -4.6e+61)
(and (not (<= c -3e-25))
(or (<= c 4.2e-72)
(and (not (<= c 2.9e-51)) (<= c 11500000.0)))))))
t_1
(* 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 t_1 = (c * ((a + (b * c)) * i)) * -2.0;
double tmp;
if (c <= -3e+144) {
tmp = t_1;
} else if (c <= -8.6e+98) {
tmp = 2.0 * ((z * t) - (c * (a * i)));
} else if ((c <= -8e+79) || !((c <= -4.6e+61) || (!(c <= -3e-25) && ((c <= 4.2e-72) || (!(c <= 2.9e-51) && (c <= 11500000.0)))))) {
tmp = t_1;
} 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) :: t_1
real(8) :: tmp
t_1 = (c * ((a + (b * c)) * i)) * (-2.0d0)
if (c <= (-3d+144)) then
tmp = t_1
else if (c <= (-8.6d+98)) then
tmp = 2.0d0 * ((z * t) - (c * (a * i)))
else if ((c <= (-8d+79)) .or. (.not. (c <= (-4.6d+61)) .or. (.not. (c <= (-3d-25))) .and. (c <= 4.2d-72) .or. (.not. (c <= 2.9d-51)) .and. (c <= 11500000.0d0))) then
tmp = t_1
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 t_1 = (c * ((a + (b * c)) * i)) * -2.0;
double tmp;
if (c <= -3e+144) {
tmp = t_1;
} else if (c <= -8.6e+98) {
tmp = 2.0 * ((z * t) - (c * (a * i)));
} else if ((c <= -8e+79) || !((c <= -4.6e+61) || (!(c <= -3e-25) && ((c <= 4.2e-72) || (!(c <= 2.9e-51) && (c <= 11500000.0)))))) {
tmp = t_1;
} else {
tmp = 2.0 * ((x * y) + (z * t));
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = (c * ((a + (b * c)) * i)) * -2.0 tmp = 0 if c <= -3e+144: tmp = t_1 elif c <= -8.6e+98: tmp = 2.0 * ((z * t) - (c * (a * i))) elif (c <= -8e+79) or not ((c <= -4.6e+61) or (not (c <= -3e-25) and ((c <= 4.2e-72) or (not (c <= 2.9e-51) and (c <= 11500000.0))))): tmp = t_1 else: tmp = 2.0 * ((x * y) + (z * t)) return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(Float64(c * Float64(Float64(a + Float64(b * c)) * i)) * -2.0) tmp = 0.0 if (c <= -3e+144) tmp = t_1; elseif (c <= -8.6e+98) tmp = Float64(2.0 * Float64(Float64(z * t) - Float64(c * Float64(a * i)))); elseif ((c <= -8e+79) || !((c <= -4.6e+61) || (!(c <= -3e-25) && ((c <= 4.2e-72) || (!(c <= 2.9e-51) && (c <= 11500000.0)))))) tmp = t_1; 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) t_1 = (c * ((a + (b * c)) * i)) * -2.0; tmp = 0.0; if (c <= -3e+144) tmp = t_1; elseif (c <= -8.6e+98) tmp = 2.0 * ((z * t) - (c * (a * i))); elseif ((c <= -8e+79) || ~(((c <= -4.6e+61) || (~((c <= -3e-25)) && ((c <= 4.2e-72) || (~((c <= 2.9e-51)) && (c <= 11500000.0))))))) tmp = t_1; else tmp = 2.0 * ((x * y) + (z * t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(c * N[(N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision] * -2.0), $MachinePrecision]}, If[LessEqual[c, -3e+144], t$95$1, If[LessEqual[c, -8.6e+98], N[(2.0 * N[(N[(z * t), $MachinePrecision] - N[(c * N[(a * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[c, -8e+79], N[Not[Or[LessEqual[c, -4.6e+61], And[N[Not[LessEqual[c, -3e-25]], $MachinePrecision], Or[LessEqual[c, 4.2e-72], And[N[Not[LessEqual[c, 2.9e-51]], $MachinePrecision], LessEqual[c, 11500000.0]]]]]], $MachinePrecision]], t$95$1, N[(2.0 * N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(c \cdot \left(\left(a + b \cdot c\right) \cdot i\right)\right) \cdot -2\\
\mathbf{if}\;c \leq -3 \cdot 10^{+144}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;c \leq -8.6 \cdot 10^{+98}:\\
\;\;\;\;2 \cdot \left(z \cdot t - c \cdot \left(a \cdot i\right)\right)\\
\mathbf{elif}\;c \leq -8 \cdot 10^{+79} \lor \neg \left(c \leq -4.6 \cdot 10^{+61} \lor \neg \left(c \leq -3 \cdot 10^{-25}\right) \land \left(c \leq 4.2 \cdot 10^{-72} \lor \neg \left(c \leq 2.9 \cdot 10^{-51}\right) \land c \leq 11500000\right)\right):\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(x \cdot y + z \cdot t\right)\\
\end{array}
\end{array}
if c < -2.9999999999999999e144 or -8.6000000000000003e98 < c < -7.99999999999999974e79 or -4.5999999999999999e61 < c < -2.9999999999999998e-25 or 4.2e-72 < c < 2.89999999999999973e-51 or 1.15e7 < c Initial program 78.3%
associate-*l*89.3%
fma-def90.1%
Simplified90.1%
fma-def89.3%
+-commutative89.3%
Applied egg-rr89.3%
Taylor expanded in c around inf 66.3%
associate-*r*66.3%
neg-mul-166.3%
unpow266.3%
distribute-lft-neg-in66.3%
associate-*l*73.9%
*-commutative73.9%
associate-*r*73.4%
neg-mul-173.4%
distribute-lft-neg-in73.4%
distribute-lft-in79.3%
distribute-rgt-in80.9%
+-commutative80.9%
*-commutative80.9%
associate-*r*80.2%
distribute-lft-neg-in80.2%
*-commutative80.2%
distribute-rgt-neg-in80.2%
*-commutative80.2%
+-commutative80.2%
fma-def80.2%
Simplified80.2%
Taylor expanded in i around 0 80.9%
if -2.9999999999999999e144 < c < -8.6000000000000003e98Initial program 90.4%
Taylor expanded in a around inf 83.0%
Taylor expanded in x around 0 92.6%
*-commutative92.6%
Simplified92.6%
if -7.99999999999999974e79 < c < -4.5999999999999999e61 or -2.9999999999999998e-25 < c < 4.2e-72 or 2.89999999999999973e-51 < c < 1.15e7Initial program 97.6%
Taylor expanded in c around 0 77.2%
Final simplification79.6%
(FPCore (x y z t a b c i)
:precision binary64
(if (or (<= c -1.16e+80)
(not
(or (<= c -4.6e+61)
(and (not (<= c -1.25e-24))
(or (<= c 2.3e-71)
(and (not (<= c 2.6e-51)) (<= c 7000000.0)))))))
(* (* c (* (+ a (* b c)) i)) -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 <= -1.16e+80) || !((c <= -4.6e+61) || (!(c <= -1.25e-24) && ((c <= 2.3e-71) || (!(c <= 2.6e-51) && (c <= 7000000.0)))))) {
tmp = (c * ((a + (b * c)) * i)) * -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 <= (-1.16d+80)) .or. (.not. (c <= (-4.6d+61)) .or. (.not. (c <= (-1.25d-24))) .and. (c <= 2.3d-71) .or. (.not. (c <= 2.6d-51)) .and. (c <= 7000000.0d0))) then
tmp = (c * ((a + (b * c)) * i)) * (-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 <= -1.16e+80) || !((c <= -4.6e+61) || (!(c <= -1.25e-24) && ((c <= 2.3e-71) || (!(c <= 2.6e-51) && (c <= 7000000.0)))))) {
tmp = (c * ((a + (b * c)) * i)) * -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 <= -1.16e+80) or not ((c <= -4.6e+61) or (not (c <= -1.25e-24) and ((c <= 2.3e-71) or (not (c <= 2.6e-51) and (c <= 7000000.0))))): tmp = (c * ((a + (b * c)) * i)) * -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 <= -1.16e+80) || !((c <= -4.6e+61) || (!(c <= -1.25e-24) && ((c <= 2.3e-71) || (!(c <= 2.6e-51) && (c <= 7000000.0)))))) tmp = Float64(Float64(c * Float64(Float64(a + Float64(b * c)) * i)) * -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 <= -1.16e+80) || ~(((c <= -4.6e+61) || (~((c <= -1.25e-24)) && ((c <= 2.3e-71) || (~((c <= 2.6e-51)) && (c <= 7000000.0))))))) tmp = (c * ((a + (b * c)) * i)) * -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, -1.16e+80], N[Not[Or[LessEqual[c, -4.6e+61], And[N[Not[LessEqual[c, -1.25e-24]], $MachinePrecision], Or[LessEqual[c, 2.3e-71], And[N[Not[LessEqual[c, 2.6e-51]], $MachinePrecision], LessEqual[c, 7000000.0]]]]]], $MachinePrecision]], N[(N[(c * N[(N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision] * -2.0), $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 -1.16 \cdot 10^{+80} \lor \neg \left(c \leq -4.6 \cdot 10^{+61} \lor \neg \left(c \leq -1.25 \cdot 10^{-24}\right) \land \left(c \leq 2.3 \cdot 10^{-71} \lor \neg \left(c \leq 2.6 \cdot 10^{-51}\right) \land c \leq 7000000\right)\right):\\
\;\;\;\;\left(c \cdot \left(\left(a + b \cdot c\right) \cdot i\right)\right) \cdot -2\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(x \cdot y + z \cdot t\right)\\
\end{array}
\end{array}
if c < -1.15999999999999997e80 or -4.5999999999999999e61 < c < -1.24999999999999995e-24 or 2.2999999999999998e-71 < c < 2.6e-51 or 7e6 < c Initial program 79.2%
associate-*l*90.1%
fma-def90.9%
Simplified90.9%
fma-def90.1%
+-commutative90.1%
Applied egg-rr90.1%
Taylor expanded in c around inf 64.4%
associate-*r*64.4%
neg-mul-164.4%
unpow264.4%
distribute-lft-neg-in64.4%
associate-*l*71.4%
*-commutative71.4%
associate-*r*71.0%
neg-mul-171.0%
distribute-lft-neg-in71.0%
distribute-lft-in77.1%
distribute-rgt-in78.7%
+-commutative78.7%
*-commutative78.7%
associate-*r*77.9%
distribute-lft-neg-in77.9%
*-commutative77.9%
distribute-rgt-neg-in77.9%
*-commutative77.9%
+-commutative77.9%
fma-def78.0%
Simplified78.0%
Taylor expanded in i around 0 78.7%
if -1.15999999999999997e80 < c < -4.5999999999999999e61 or -1.24999999999999995e-24 < c < 2.2999999999999998e-71 or 2.6e-51 < c < 7e6Initial program 97.6%
Taylor expanded in c around 0 77.2%
Final simplification78.0%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* 2.0 (- (* z t) (* c (* (+ a (* b c)) i))))))
(if (<= x -1.3e+153)
(* 2.0 (- (* x y) (* c (* i (* b c)))))
(if (<= x -6.2e+107)
t_1
(if (<= x -4.5e+23)
(* 2.0 (- (* x y) (* c (* a i))))
(if (<= x 7.4e-96) t_1 (* 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 t_1 = 2.0 * ((z * t) - (c * ((a + (b * c)) * i)));
double tmp;
if (x <= -1.3e+153) {
tmp = 2.0 * ((x * y) - (c * (i * (b * c))));
} else if (x <= -6.2e+107) {
tmp = t_1;
} else if (x <= -4.5e+23) {
tmp = 2.0 * ((x * y) - (c * (a * i)));
} else if (x <= 7.4e-96) {
tmp = t_1;
} 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) :: t_1
real(8) :: tmp
t_1 = 2.0d0 * ((z * t) - (c * ((a + (b * c)) * i)))
if (x <= (-1.3d+153)) then
tmp = 2.0d0 * ((x * y) - (c * (i * (b * c))))
else if (x <= (-6.2d+107)) then
tmp = t_1
else if (x <= (-4.5d+23)) then
tmp = 2.0d0 * ((x * y) - (c * (a * i)))
else if (x <= 7.4d-96) then
tmp = t_1
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 t_1 = 2.0 * ((z * t) - (c * ((a + (b * c)) * i)));
double tmp;
if (x <= -1.3e+153) {
tmp = 2.0 * ((x * y) - (c * (i * (b * c))));
} else if (x <= -6.2e+107) {
tmp = t_1;
} else if (x <= -4.5e+23) {
tmp = 2.0 * ((x * y) - (c * (a * i)));
} else if (x <= 7.4e-96) {
tmp = t_1;
} else {
tmp = 2.0 * ((x * y) - (i * (a * c)));
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = 2.0 * ((z * t) - (c * ((a + (b * c)) * i))) tmp = 0 if x <= -1.3e+153: tmp = 2.0 * ((x * y) - (c * (i * (b * c)))) elif x <= -6.2e+107: tmp = t_1 elif x <= -4.5e+23: tmp = 2.0 * ((x * y) - (c * (a * i))) elif x <= 7.4e-96: tmp = t_1 else: tmp = 2.0 * ((x * y) - (i * (a * c))) return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(2.0 * Float64(Float64(z * t) - Float64(c * Float64(Float64(a + Float64(b * c)) * i)))) tmp = 0.0 if (x <= -1.3e+153) tmp = Float64(2.0 * Float64(Float64(x * y) - Float64(c * Float64(i * Float64(b * c))))); elseif (x <= -6.2e+107) tmp = t_1; elseif (x <= -4.5e+23) tmp = Float64(2.0 * Float64(Float64(x * y) - Float64(c * Float64(a * i)))); elseif (x <= 7.4e-96) tmp = t_1; 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) t_1 = 2.0 * ((z * t) - (c * ((a + (b * c)) * i))); tmp = 0.0; if (x <= -1.3e+153) tmp = 2.0 * ((x * y) - (c * (i * (b * c)))); elseif (x <= -6.2e+107) tmp = t_1; elseif (x <= -4.5e+23) tmp = 2.0 * ((x * y) - (c * (a * i))); elseif (x <= 7.4e-96) tmp = t_1; else tmp = 2.0 * ((x * y) - (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[(N[(z * t), $MachinePrecision] - N[(c * N[(N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -1.3e+153], N[(2.0 * N[(N[(x * y), $MachinePrecision] - N[(c * N[(i * N[(b * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -6.2e+107], t$95$1, If[LessEqual[x, -4.5e+23], N[(2.0 * N[(N[(x * y), $MachinePrecision] - N[(c * N[(a * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 7.4e-96], t$95$1, N[(2.0 * N[(N[(x * y), $MachinePrecision] - N[(i * N[(a * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := 2 \cdot \left(z \cdot t - c \cdot \left(\left(a + b \cdot c\right) \cdot i\right)\right)\\
\mathbf{if}\;x \leq -1.3 \cdot 10^{+153}:\\
\;\;\;\;2 \cdot \left(x \cdot y - c \cdot \left(i \cdot \left(b \cdot c\right)\right)\right)\\
\mathbf{elif}\;x \leq -6.2 \cdot 10^{+107}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq -4.5 \cdot 10^{+23}:\\
\;\;\;\;2 \cdot \left(x \cdot y - c \cdot \left(a \cdot i\right)\right)\\
\mathbf{elif}\;x \leq 7.4 \cdot 10^{-96}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(x \cdot y - i \cdot \left(a \cdot c\right)\right)\\
\end{array}
\end{array}
if x < -1.2999999999999999e153Initial program 90.7%
Taylor expanded in z around 0 83.8%
Taylor expanded in c around inf 76.3%
*-commutative76.3%
associate-*l*76.3%
*-commutative76.3%
Simplified76.3%
if -1.2999999999999999e153 < x < -6.20000000000000052e107 or -4.49999999999999979e23 < x < 7.39999999999999972e-96Initial program 86.3%
Taylor expanded in x around 0 80.9%
if -6.20000000000000052e107 < x < -4.49999999999999979e23Initial program 87.8%
Taylor expanded in a around inf 82.0%
Taylor expanded in z around 0 81.9%
if 7.39999999999999972e-96 < x Initial program 89.7%
Taylor expanded in z around 0 71.2%
Taylor expanded in c around 0 52.8%
neg-mul-152.8%
sub-neg52.8%
associate-*r*56.0%
Simplified56.0%
Final simplification71.8%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* 2.0 (+ (* x y) (* z t))))
(t_2 (* (* c (* (+ a (* b c)) i)) -2.0)))
(if (<= i -3.9e+87)
t_2
(if (<= i 1.6e-178)
t_1
(if (<= i 8.2e-23)
t_2
(if (<= i 2.2e+20)
t_1
(if (<= i 2.25e+57) t_2 (* 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 t_1 = 2.0 * ((x * y) + (z * t));
double t_2 = (c * ((a + (b * c)) * i)) * -2.0;
double tmp;
if (i <= -3.9e+87) {
tmp = t_2;
} else if (i <= 1.6e-178) {
tmp = t_1;
} else if (i <= 8.2e-23) {
tmp = t_2;
} else if (i <= 2.2e+20) {
tmp = t_1;
} else if (i <= 2.25e+57) {
tmp = t_2;
} 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) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = 2.0d0 * ((x * y) + (z * t))
t_2 = (c * ((a + (b * c)) * i)) * (-2.0d0)
if (i <= (-3.9d+87)) then
tmp = t_2
else if (i <= 1.6d-178) then
tmp = t_1
else if (i <= 8.2d-23) then
tmp = t_2
else if (i <= 2.2d+20) then
tmp = t_1
else if (i <= 2.25d+57) then
tmp = t_2
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 t_1 = 2.0 * ((x * y) + (z * t));
double t_2 = (c * ((a + (b * c)) * i)) * -2.0;
double tmp;
if (i <= -3.9e+87) {
tmp = t_2;
} else if (i <= 1.6e-178) {
tmp = t_1;
} else if (i <= 8.2e-23) {
tmp = t_2;
} else if (i <= 2.2e+20) {
tmp = t_1;
} else if (i <= 2.25e+57) {
tmp = t_2;
} else {
tmp = 2.0 * ((x * y) - (i * (a * c)));
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = 2.0 * ((x * y) + (z * t)) t_2 = (c * ((a + (b * c)) * i)) * -2.0 tmp = 0 if i <= -3.9e+87: tmp = t_2 elif i <= 1.6e-178: tmp = t_1 elif i <= 8.2e-23: tmp = t_2 elif i <= 2.2e+20: tmp = t_1 elif i <= 2.25e+57: tmp = t_2 else: tmp = 2.0 * ((x * y) - (i * (a * c))) 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(Float64(c * Float64(Float64(a + Float64(b * c)) * i)) * -2.0) tmp = 0.0 if (i <= -3.9e+87) tmp = t_2; elseif (i <= 1.6e-178) tmp = t_1; elseif (i <= 8.2e-23) tmp = t_2; elseif (i <= 2.2e+20) tmp = t_1; elseif (i <= 2.25e+57) tmp = t_2; 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) t_1 = 2.0 * ((x * y) + (z * t)); t_2 = (c * ((a + (b * c)) * i)) * -2.0; tmp = 0.0; if (i <= -3.9e+87) tmp = t_2; elseif (i <= 1.6e-178) tmp = t_1; elseif (i <= 8.2e-23) tmp = t_2; elseif (i <= 2.2e+20) tmp = t_1; elseif (i <= 2.25e+57) tmp = t_2; else tmp = 2.0 * ((x * y) - (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[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(c * N[(N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision] * -2.0), $MachinePrecision]}, If[LessEqual[i, -3.9e+87], t$95$2, If[LessEqual[i, 1.6e-178], t$95$1, If[LessEqual[i, 8.2e-23], t$95$2, If[LessEqual[i, 2.2e+20], t$95$1, If[LessEqual[i, 2.25e+57], t$95$2, N[(2.0 * N[(N[(x * y), $MachinePrecision] - N[(i * N[(a * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := 2 \cdot \left(x \cdot y + z \cdot t\right)\\
t_2 := \left(c \cdot \left(\left(a + b \cdot c\right) \cdot i\right)\right) \cdot -2\\
\mathbf{if}\;i \leq -3.9 \cdot 10^{+87}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;i \leq 1.6 \cdot 10^{-178}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;i \leq 8.2 \cdot 10^{-23}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;i \leq 2.2 \cdot 10^{+20}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;i \leq 2.25 \cdot 10^{+57}:\\
\;\;\;\;t_2\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(x \cdot y - i \cdot \left(a \cdot c\right)\right)\\
\end{array}
\end{array}
if i < -3.9000000000000002e87 or 1.6e-178 < i < 8.20000000000000059e-23 or 2.2e20 < i < 2.24999999999999998e57Initial program 92.2%
associate-*l*92.1%
fma-def93.2%
Simplified93.2%
fma-def92.1%
+-commutative92.1%
Applied egg-rr92.1%
Taylor expanded in c around inf 51.4%
associate-*r*51.4%
neg-mul-151.4%
unpow251.4%
distribute-lft-neg-in51.4%
associate-*l*60.1%
*-commutative60.1%
associate-*r*63.5%
neg-mul-163.5%
distribute-lft-neg-in63.5%
distribute-lft-in69.2%
distribute-rgt-in70.4%
+-commutative70.4%
*-commutative70.4%
associate-*r*69.3%
distribute-lft-neg-in69.3%
*-commutative69.3%
distribute-rgt-neg-in69.3%
*-commutative69.3%
+-commutative69.3%
fma-def69.3%
Simplified69.3%
Taylor expanded in i around 0 70.4%
if -3.9000000000000002e87 < i < 1.6e-178 or 8.20000000000000059e-23 < i < 2.2e20Initial program 82.9%
Taylor expanded in c around 0 72.5%
if 2.24999999999999998e57 < i Initial program 95.4%
Taylor expanded in z around 0 71.4%
Taylor expanded in c around 0 54.3%
neg-mul-154.3%
sub-neg54.3%
associate-*r*66.7%
Simplified66.7%
Final simplification70.8%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* c (* (+ a (* b c)) i))))
(if (or (<= y -7.5e-137) (not (<= y 1.12e+76)))
(* 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 ((y <= -7.5e-137) || !(y <= 1.12e+76)) {
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 ((y <= (-7.5d-137)) .or. (.not. (y <= 1.12d+76))) 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 ((y <= -7.5e-137) || !(y <= 1.12e+76)) {
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 (y <= -7.5e-137) or not (y <= 1.12e+76): 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 ((y <= -7.5e-137) || !(y <= 1.12e+76)) 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 ((y <= -7.5e-137) || ~((y <= 1.12e+76))) 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[y, -7.5e-137], N[Not[LessEqual[y, 1.12e+76]], $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}\;y \leq -7.5 \cdot 10^{-137} \lor \neg \left(y \leq 1.12 \cdot 10^{+76}\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 y < -7.4999999999999995e-137 or 1.12000000000000005e76 < y Initial program 87.8%
Taylor expanded in z around 0 81.6%
if -7.4999999999999995e-137 < y < 1.12000000000000005e76Initial program 88.7%
Taylor expanded in x around 0 79.4%
Final simplification80.5%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* c (* (+ a (* b c)) i))))
(if (<= c -9e-23)
(* 2.0 (- (* x y) t_1))
(if (<= c 9000000.0)
(* 2.0 (- (+ (* x y) (* z t)) (* i (* a c))))
(* 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 (c <= -9e-23) {
tmp = 2.0 * ((x * y) - t_1);
} else if (c <= 9000000.0) {
tmp = 2.0 * (((x * y) + (z * t)) - (i * (a * c)));
} 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 (c <= (-9d-23)) then
tmp = 2.0d0 * ((x * y) - t_1)
else if (c <= 9000000.0d0) then
tmp = 2.0d0 * (((x * y) + (z * t)) - (i * (a * c)))
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 (c <= -9e-23) {
tmp = 2.0 * ((x * y) - t_1);
} else if (c <= 9000000.0) {
tmp = 2.0 * (((x * y) + (z * t)) - (i * (a * c)));
} 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 c <= -9e-23: tmp = 2.0 * ((x * y) - t_1) elif c <= 9000000.0: tmp = 2.0 * (((x * y) + (z * t)) - (i * (a * c))) 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 (c <= -9e-23) tmp = Float64(2.0 * Float64(Float64(x * y) - t_1)); elseif (c <= 9000000.0) tmp = Float64(2.0 * Float64(Float64(Float64(x * y) + Float64(z * t)) - Float64(i * Float64(a * c)))); 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 (c <= -9e-23) tmp = 2.0 * ((x * y) - t_1); elseif (c <= 9000000.0) tmp = 2.0 * (((x * y) + (z * t)) - (i * (a * c))); 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[LessEqual[c, -9e-23], N[(2.0 * N[(N[(x * y), $MachinePrecision] - t$95$1), $MachinePrecision]), $MachinePrecision], If[LessEqual[c, 9000000.0], N[(2.0 * N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] - N[(i * N[(a * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[(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}\;c \leq -9 \cdot 10^{-23}:\\
\;\;\;\;2 \cdot \left(x \cdot y - t_1\right)\\
\mathbf{elif}\;c \leq 9000000:\\
\;\;\;\;2 \cdot \left(\left(x \cdot y + z \cdot t\right) - i \cdot \left(a \cdot c\right)\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(z \cdot t - t_1\right)\\
\end{array}
\end{array}
if c < -8.9999999999999995e-23Initial program 83.5%
Taylor expanded in z around 0 85.8%
if -8.9999999999999995e-23 < c < 9e6Initial program 98.3%
Taylor expanded in a around inf 92.1%
if 9e6 < c Initial program 73.1%
Taylor expanded in x around 0 85.3%
Final simplification88.8%
(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}
Initial program 88.2%
associate-*l*92.7%
fma-def93.4%
Simplified93.4%
fma-def92.7%
+-commutative92.7%
Applied egg-rr92.7%
Final simplification92.7%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* c (* -2.0 (* c (* b i))))))
(if (<= c -3e+144)
t_1
(if (<= c 11500000.0)
(* 2.0 (+ (* x y) (* z t)))
(if (<= c 5.5e+60) (* -2.0 (* c (* a i))) t_1)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = c * (-2.0 * (c * (b * i)));
double tmp;
if (c <= -3e+144) {
tmp = t_1;
} else if (c <= 11500000.0) {
tmp = 2.0 * ((x * y) + (z * t));
} else if (c <= 5.5e+60) {
tmp = -2.0 * (c * (a * i));
} else {
tmp = 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 * ((-2.0d0) * (c * (b * i)))
if (c <= (-3d+144)) then
tmp = t_1
else if (c <= 11500000.0d0) then
tmp = 2.0d0 * ((x * y) + (z * t))
else if (c <= 5.5d+60) then
tmp = (-2.0d0) * (c * (a * i))
else
tmp = 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 * (-2.0 * (c * (b * i)));
double tmp;
if (c <= -3e+144) {
tmp = t_1;
} else if (c <= 11500000.0) {
tmp = 2.0 * ((x * y) + (z * t));
} else if (c <= 5.5e+60) {
tmp = -2.0 * (c * (a * i));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = c * (-2.0 * (c * (b * i))) tmp = 0 if c <= -3e+144: tmp = t_1 elif c <= 11500000.0: tmp = 2.0 * ((x * y) + (z * t)) elif c <= 5.5e+60: tmp = -2.0 * (c * (a * i)) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(c * Float64(-2.0 * Float64(c * Float64(b * i)))) tmp = 0.0 if (c <= -3e+144) tmp = t_1; elseif (c <= 11500000.0) tmp = Float64(2.0 * Float64(Float64(x * y) + Float64(z * t))); elseif (c <= 5.5e+60) tmp = Float64(-2.0 * Float64(c * Float64(a * i))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = c * (-2.0 * (c * (b * i))); tmp = 0.0; if (c <= -3e+144) tmp = t_1; elseif (c <= 11500000.0) tmp = 2.0 * ((x * y) + (z * t)); elseif (c <= 5.5e+60) tmp = -2.0 * (c * (a * i)); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(c * N[(-2.0 * N[(c * N[(b * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[c, -3e+144], t$95$1, If[LessEqual[c, 11500000.0], N[(2.0 * N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[c, 5.5e+60], N[(-2.0 * N[(c * N[(a * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := c \cdot \left(-2 \cdot \left(c \cdot \left(b \cdot i\right)\right)\right)\\
\mathbf{if}\;c \leq -3 \cdot 10^{+144}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;c \leq 11500000:\\
\;\;\;\;2 \cdot \left(x \cdot y + z \cdot t\right)\\
\mathbf{elif}\;c \leq 5.5 \cdot 10^{+60}:\\
\;\;\;\;-2 \cdot \left(c \cdot \left(a \cdot i\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if c < -2.9999999999999999e144 or 5.5000000000000001e60 < c Initial program 72.9%
Taylor expanded in b around inf 67.9%
mul-1-neg67.9%
distribute-rgt-neg-in67.9%
unpow267.9%
Simplified67.9%
Taylor expanded in c around 0 67.9%
*-commutative67.9%
unpow267.9%
associate-*r*72.0%
*-commutative72.0%
associate-*l*72.0%
*-commutative72.0%
Simplified72.0%
if -2.9999999999999999e144 < c < 1.15e7Initial program 95.8%
Taylor expanded in c around 0 68.7%
if 1.15e7 < c < 5.5000000000000001e60Initial program 90.8%
Taylor expanded in a around inf 67.7%
associate-*r*67.7%
neg-mul-167.7%
Simplified67.7%
Taylor expanded in c around 0 67.7%
*-commutative67.7%
Simplified67.7%
Final simplification69.7%
(FPCore (x y z t a b c i)
:precision binary64
(if (<= c -3e+144)
(* 2.0 (* c (* i (* c (- b)))))
(if (<= c 11000000.0)
(* 2.0 (+ (* x y) (* z t)))
(if (<= c 6.5e+55) (* -2.0 (* c (* a i))) (* c (* -2.0 (* c (* b i))))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (c <= -3e+144) {
tmp = 2.0 * (c * (i * (c * -b)));
} else if (c <= 11000000.0) {
tmp = 2.0 * ((x * y) + (z * t));
} else if (c <= 6.5e+55) {
tmp = -2.0 * (c * (a * i));
} else {
tmp = c * (-2.0 * (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 (c <= (-3d+144)) then
tmp = 2.0d0 * (c * (i * (c * -b)))
else if (c <= 11000000.0d0) then
tmp = 2.0d0 * ((x * y) + (z * t))
else if (c <= 6.5d+55) then
tmp = (-2.0d0) * (c * (a * i))
else
tmp = c * ((-2.0d0) * (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 (c <= -3e+144) {
tmp = 2.0 * (c * (i * (c * -b)));
} else if (c <= 11000000.0) {
tmp = 2.0 * ((x * y) + (z * t));
} else if (c <= 6.5e+55) {
tmp = -2.0 * (c * (a * i));
} else {
tmp = c * (-2.0 * (c * (b * i)));
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if c <= -3e+144: tmp = 2.0 * (c * (i * (c * -b))) elif c <= 11000000.0: tmp = 2.0 * ((x * y) + (z * t)) elif c <= 6.5e+55: tmp = -2.0 * (c * (a * i)) else: tmp = c * (-2.0 * (c * (b * i))) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (c <= -3e+144) tmp = Float64(2.0 * Float64(c * Float64(i * Float64(c * Float64(-b))))); elseif (c <= 11000000.0) tmp = Float64(2.0 * Float64(Float64(x * y) + Float64(z * t))); elseif (c <= 6.5e+55) tmp = Float64(-2.0 * Float64(c * Float64(a * i))); else tmp = Float64(c * Float64(-2.0 * 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 (c <= -3e+144) tmp = 2.0 * (c * (i * (c * -b))); elseif (c <= 11000000.0) tmp = 2.0 * ((x * y) + (z * t)); elseif (c <= 6.5e+55) tmp = -2.0 * (c * (a * i)); else tmp = c * (-2.0 * (c * (b * i))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[c, -3e+144], N[(2.0 * N[(c * N[(i * N[(c * (-b)), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[c, 11000000.0], N[(2.0 * N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[c, 6.5e+55], N[(-2.0 * N[(c * N[(a * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(c * N[(-2.0 * N[(c * N[(b * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;c \leq -3 \cdot 10^{+144}:\\
\;\;\;\;2 \cdot \left(c \cdot \left(i \cdot \left(c \cdot \left(-b\right)\right)\right)\right)\\
\mathbf{elif}\;c \leq 11000000:\\
\;\;\;\;2 \cdot \left(x \cdot y + z \cdot t\right)\\
\mathbf{elif}\;c \leq 6.5 \cdot 10^{+55}:\\
\;\;\;\;-2 \cdot \left(c \cdot \left(a \cdot i\right)\right)\\
\mathbf{else}:\\
\;\;\;\;c \cdot \left(-2 \cdot \left(c \cdot \left(b \cdot i\right)\right)\right)\\
\end{array}
\end{array}
if c < -2.9999999999999999e144Initial program 78.8%
associate-*l*90.6%
fma-def90.6%
Simplified90.6%
fma-def90.6%
+-commutative90.6%
Applied egg-rr90.6%
Taylor expanded in a around 0 84.6%
Taylor expanded in c around inf 78.8%
mul-1-neg78.8%
associate-*l*79.0%
unpow279.0%
associate-*l*81.9%
associate-*r*78.8%
*-commutative78.8%
*-commutative78.8%
distribute-lft-neg-in78.8%
*-commutative78.8%
associate-*r*78.9%
*-commutative78.9%
distribute-rgt-neg-in78.9%
Simplified78.9%
if -2.9999999999999999e144 < c < 1.1e7Initial program 95.8%
Taylor expanded in c around 0 68.7%
if 1.1e7 < c < 6.50000000000000027e55Initial program 90.8%
Taylor expanded in a around inf 67.7%
associate-*r*67.7%
neg-mul-167.7%
Simplified67.7%
Taylor expanded in c around 0 67.7%
*-commutative67.7%
Simplified67.7%
if 6.50000000000000027e55 < c Initial program 69.2%
Taylor expanded in b around inf 61.0%
mul-1-neg61.0%
distribute-rgt-neg-in61.0%
unpow261.0%
Simplified61.0%
Taylor expanded in c around 0 61.0%
*-commutative61.0%
unpow261.0%
associate-*r*69.5%
*-commutative69.5%
associate-*l*69.5%
*-commutative69.5%
Simplified69.5%
Final simplification70.1%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* 2.0 (* z t))) (t_2 (* 2.0 (* x y))))
(if (<= y -3.15e-142)
t_2
(if (<= y 7.2e-181)
t_1
(if (<= y 1e-104)
(* 2.0 (* (* a c) (- i)))
(if (<= y 4.9e+58) 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 (y <= -3.15e-142) {
tmp = t_2;
} else if (y <= 7.2e-181) {
tmp = t_1;
} else if (y <= 1e-104) {
tmp = 2.0 * ((a * c) * -i);
} else if (y <= 4.9e+58) {
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 (y <= (-3.15d-142)) then
tmp = t_2
else if (y <= 7.2d-181) then
tmp = t_1
else if (y <= 1d-104) then
tmp = 2.0d0 * ((a * c) * -i)
else if (y <= 4.9d+58) 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 (y <= -3.15e-142) {
tmp = t_2;
} else if (y <= 7.2e-181) {
tmp = t_1;
} else if (y <= 1e-104) {
tmp = 2.0 * ((a * c) * -i);
} else if (y <= 4.9e+58) {
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 y <= -3.15e-142: tmp = t_2 elif y <= 7.2e-181: tmp = t_1 elif y <= 1e-104: tmp = 2.0 * ((a * c) * -i) elif y <= 4.9e+58: 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 (y <= -3.15e-142) tmp = t_2; elseif (y <= 7.2e-181) tmp = t_1; elseif (y <= 1e-104) tmp = Float64(2.0 * Float64(Float64(a * c) * Float64(-i))); elseif (y <= 4.9e+58) 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 (y <= -3.15e-142) tmp = t_2; elseif (y <= 7.2e-181) tmp = t_1; elseif (y <= 1e-104) tmp = 2.0 * ((a * c) * -i); elseif (y <= 4.9e+58) 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[y, -3.15e-142], t$95$2, If[LessEqual[y, 7.2e-181], t$95$1, If[LessEqual[y, 1e-104], N[(2.0 * N[(N[(a * c), $MachinePrecision] * (-i)), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 4.9e+58], 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}\;y \leq -3.15 \cdot 10^{-142}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;y \leq 7.2 \cdot 10^{-181}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq 10^{-104}:\\
\;\;\;\;2 \cdot \left(\left(a \cdot c\right) \cdot \left(-i\right)\right)\\
\mathbf{elif}\;y \leq 4.9 \cdot 10^{+58}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if y < -3.1499999999999999e-142 or 4.90000000000000018e58 < y Initial program 87.4%
Taylor expanded in x around inf 47.2%
if -3.1499999999999999e-142 < y < 7.1999999999999998e-181 or 9.99999999999999927e-105 < y < 4.90000000000000018e58Initial program 87.8%
Taylor expanded in z around inf 37.8%
if 7.1999999999999998e-181 < y < 9.99999999999999927e-105Initial program 99.9%
Taylor expanded in a around inf 30.8%
associate-*r*30.8%
neg-mul-130.8%
Simplified30.8%
Taylor expanded in c around 0 30.8%
mul-1-neg30.8%
associate-*r*50.8%
distribute-rgt-neg-in50.8%
*-commutative50.8%
Simplified50.8%
Final simplification43.4%
(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 (<= y -3.8e-136)
t_2
(if (<= y 4.2e-152)
t_1
(if (<= y 9.5e-105)
(* -2.0 (* c (* a i)))
(if (<= y 7.2e+58) 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 (y <= -3.8e-136) {
tmp = t_2;
} else if (y <= 4.2e-152) {
tmp = t_1;
} else if (y <= 9.5e-105) {
tmp = -2.0 * (c * (a * i));
} else if (y <= 7.2e+58) {
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 (y <= (-3.8d-136)) then
tmp = t_2
else if (y <= 4.2d-152) then
tmp = t_1
else if (y <= 9.5d-105) then
tmp = (-2.0d0) * (c * (a * i))
else if (y <= 7.2d+58) 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 (y <= -3.8e-136) {
tmp = t_2;
} else if (y <= 4.2e-152) {
tmp = t_1;
} else if (y <= 9.5e-105) {
tmp = -2.0 * (c * (a * i));
} else if (y <= 7.2e+58) {
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 y <= -3.8e-136: tmp = t_2 elif y <= 4.2e-152: tmp = t_1 elif y <= 9.5e-105: tmp = -2.0 * (c * (a * i)) elif y <= 7.2e+58: 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 (y <= -3.8e-136) tmp = t_2; elseif (y <= 4.2e-152) tmp = t_1; elseif (y <= 9.5e-105) tmp = Float64(-2.0 * Float64(c * Float64(a * i))); elseif (y <= 7.2e+58) 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 (y <= -3.8e-136) tmp = t_2; elseif (y <= 4.2e-152) tmp = t_1; elseif (y <= 9.5e-105) tmp = -2.0 * (c * (a * i)); elseif (y <= 7.2e+58) 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[y, -3.8e-136], t$95$2, If[LessEqual[y, 4.2e-152], t$95$1, If[LessEqual[y, 9.5e-105], N[(-2.0 * N[(c * N[(a * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 7.2e+58], 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}\;y \leq -3.8 \cdot 10^{-136}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;y \leq 4.2 \cdot 10^{-152}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq 9.5 \cdot 10^{-105}:\\
\;\;\;\;-2 \cdot \left(c \cdot \left(a \cdot i\right)\right)\\
\mathbf{elif}\;y \leq 7.2 \cdot 10^{+58}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if y < -3.8000000000000003e-136 or 7.19999999999999993e58 < y Initial program 88.0%
Taylor expanded in x around inf 47.5%
if -3.8000000000000003e-136 < y < 4.19999999999999998e-152 or 9.5000000000000002e-105 < y < 7.19999999999999993e58Initial program 87.6%
Taylor expanded in z around inf 39.3%
if 4.19999999999999998e-152 < y < 9.5000000000000002e-105Initial program 100.0%
Taylor expanded in a around inf 46.2%
associate-*r*46.2%
neg-mul-146.2%
Simplified46.2%
Taylor expanded in c around 0 46.2%
*-commutative46.2%
Simplified46.2%
Final simplification43.8%
(FPCore (x y z t a b c i) :precision binary64 (if (<= a 2.05e+99) (* 2.0 (+ (* x y) (* z t))) (* 2.0 (* (* a c) (- i)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (a <= 2.05e+99) {
tmp = 2.0 * ((x * y) + (z * t));
} else {
tmp = 2.0 * ((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 (a <= 2.05d+99) then
tmp = 2.0d0 * ((x * y) + (z * t))
else
tmp = 2.0d0 * ((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 (a <= 2.05e+99) {
tmp = 2.0 * ((x * y) + (z * t));
} else {
tmp = 2.0 * ((a * c) * -i);
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if a <= 2.05e+99: tmp = 2.0 * ((x * y) + (z * t)) else: tmp = 2.0 * ((a * c) * -i) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (a <= 2.05e+99) tmp = Float64(2.0 * Float64(Float64(x * y) + Float64(z * t))); else tmp = Float64(2.0 * Float64(Float64(a * c) * Float64(-i))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if (a <= 2.05e+99) tmp = 2.0 * ((x * y) + (z * t)); else tmp = 2.0 * ((a * c) * -i); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[a, 2.05e+99], N[(2.0 * N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[(a * c), $MachinePrecision] * (-i)), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq 2.05 \cdot 10^{+99}:\\
\;\;\;\;2 \cdot \left(x \cdot y + z \cdot t\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(\left(a \cdot c\right) \cdot \left(-i\right)\right)\\
\end{array}
\end{array}
if a < 2.0499999999999999e99Initial program 89.2%
Taylor expanded in c around 0 59.2%
if 2.0499999999999999e99 < a Initial program 82.7%
Taylor expanded in a around inf 49.4%
associate-*r*49.4%
neg-mul-149.4%
Simplified49.4%
Taylor expanded in c around 0 49.4%
mul-1-neg49.4%
associate-*r*63.7%
distribute-rgt-neg-in63.7%
*-commutative63.7%
Simplified63.7%
Final simplification59.8%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= y -2.35e-136) (not (<= y 1.75e+58))) (* 2.0 (* x y)) (* 2.0 (* z t))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((y <= -2.35e-136) || !(y <= 1.75e+58)) {
tmp = 2.0 * (x * y);
} else {
tmp = 2.0 * (z * t);
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: tmp
if ((y <= (-2.35d-136)) .or. (.not. (y <= 1.75d+58))) then
tmp = 2.0d0 * (x * y)
else
tmp = 2.0d0 * (z * t)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((y <= -2.35e-136) || !(y <= 1.75e+58)) {
tmp = 2.0 * (x * y);
} else {
tmp = 2.0 * (z * t);
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if (y <= -2.35e-136) or not (y <= 1.75e+58): tmp = 2.0 * (x * y) else: tmp = 2.0 * (z * t) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if ((y <= -2.35e-136) || !(y <= 1.75e+58)) tmp = Float64(2.0 * Float64(x * y)); else tmp = Float64(2.0 * Float64(z * t)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if ((y <= -2.35e-136) || ~((y <= 1.75e+58))) tmp = 2.0 * (x * y); else tmp = 2.0 * (z * t); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[y, -2.35e-136], N[Not[LessEqual[y, 1.75e+58]], $MachinePrecision]], N[(2.0 * N[(x * y), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(z * t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.35 \cdot 10^{-136} \lor \neg \left(y \leq 1.75 \cdot 10^{+58}\right):\\
\;\;\;\;2 \cdot \left(x \cdot y\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(z \cdot t\right)\\
\end{array}
\end{array}
if y < -2.35000000000000011e-136 or 1.7499999999999999e58 < y Initial program 88.0%
Taylor expanded in x around inf 47.5%
if -2.35000000000000011e-136 < y < 1.7499999999999999e58Initial program 88.5%
Taylor expanded in z around inf 37.4%
Final simplification42.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 88.2%
Taylor expanded in z around inf 29.0%
Final simplification29.0%
(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 2023214
(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))))