
(FPCore (x y z t a b c i) :precision binary64 (* 2.0 (- (+ (* x y) (* z t)) (* (* (+ a (* b c)) c) i))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return 2.0 * (((x * y) + (z * t)) - (((a + (b * c)) * c) * i));
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
code = 2.0d0 * (((x * y) + (z * t)) - (((a + (b * c)) * c) * i))
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return 2.0 * (((x * y) + (z * t)) - (((a + (b * c)) * c) * i));
}
def code(x, y, z, t, a, b, c, i): return 2.0 * (((x * y) + (z * t)) - (((a + (b * c)) * c) * i))
function code(x, y, z, t, a, b, c, i) return Float64(2.0 * Float64(Float64(Float64(x * y) + Float64(z * t)) - Float64(Float64(Float64(a + Float64(b * c)) * c) * i))) end
function tmp = code(x, y, z, t, a, b, c, i) tmp = 2.0 * (((x * y) + (z * t)) - (((a + (b * c)) * c) * i)); end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(2.0 * N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] - N[(N[(N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision] * c), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
2 \cdot \left(\left(x \cdot y + z \cdot t\right) - \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i\right)
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 15 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a b c i) :precision binary64 (* 2.0 (- (+ (* x y) (* z t)) (* (* (+ a (* b c)) c) i))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return 2.0 * (((x * y) + (z * t)) - (((a + (b * c)) * c) * i));
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
code = 2.0d0 * (((x * y) + (z * t)) - (((a + (b * c)) * c) * i))
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return 2.0 * (((x * y) + (z * t)) - (((a + (b * c)) * c) * i));
}
def code(x, y, z, t, a, b, c, i): return 2.0 * (((x * y) + (z * t)) - (((a + (b * c)) * c) * i))
function code(x, y, z, t, a, b, c, i) return Float64(2.0 * Float64(Float64(Float64(x * y) + Float64(z * t)) - Float64(Float64(Float64(a + Float64(b * c)) * c) * i))) end
function tmp = code(x, y, z, t, a, b, c, i) tmp = 2.0 * (((x * y) + (z * t)) - (((a + (b * c)) * c) * i)); end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(2.0 * N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] - N[(N[(N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision] * c), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
2 \cdot \left(\left(x \cdot y + z \cdot t\right) - \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i\right)
\end{array}
(FPCore (x y z t a b c i) :precision binary64 (* 2.0 (fma z t (fma x y (* (fma b c a) (- (* c i)))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return 2.0 * fma(z, t, fma(x, y, (fma(b, c, a) * -(c * i))));
}
function code(x, y, z, t, a, b, c, i) return Float64(2.0 * fma(z, t, fma(x, y, Float64(fma(b, c, a) * Float64(-Float64(c * i)))))) end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(2.0 * N[(z * t + N[(x * y + N[(N[(b * c + a), $MachinePrecision] * (-N[(c * i), $MachinePrecision])), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
2 \cdot \mathsf{fma}\left(z, t, \mathsf{fma}\left(x, y, \mathsf{fma}\left(b, c, a\right) \cdot \left(-c \cdot i\right)\right)\right)
\end{array}
Initial program 89.0%
associate--l+89.0%
*-commutative89.0%
associate--l+89.0%
associate--l+89.0%
*-commutative89.0%
associate--l+89.0%
fma-def89.0%
associate-*l*93.4%
Simplified93.4%
fma-def93.4%
+-commutative93.4%
Applied egg-rr93.4%
associate--l+93.4%
fma-def95.4%
fma-neg97.7%
distribute-rgt-neg-in97.7%
+-commutative97.7%
fma-def97.7%
Applied egg-rr97.7%
Final simplification97.7%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ a (* b c))) (t_2 (* c (* i t_1))) (t_3 (* i (* c t_1))))
(if (<= t_3 (- INFINITY))
(* -2.0 t_2)
(if (<= t_3 5e+297)
(* 2.0 (- (+ (* x y) (* z t)) 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 * (i * t_1);
double t_3 = i * (c * t_1);
double tmp;
if (t_3 <= -((double) INFINITY)) {
tmp = -2.0 * t_2;
} else if (t_3 <= 5e+297) {
tmp = 2.0 * (((x * y) + (z * t)) - 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 * (i * t_1);
double t_3 = i * (c * t_1);
double tmp;
if (t_3 <= -Double.POSITIVE_INFINITY) {
tmp = -2.0 * t_2;
} else if (t_3 <= 5e+297) {
tmp = 2.0 * (((x * y) + (z * t)) - 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 * (i * t_1) t_3 = i * (c * t_1) tmp = 0 if t_3 <= -math.inf: tmp = -2.0 * t_2 elif t_3 <= 5e+297: tmp = 2.0 * (((x * y) + (z * t)) - 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(i * t_1)) 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 <= 5e+297) tmp = Float64(2.0 * Float64(Float64(Float64(x * y) + Float64(z * t)) - 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 * (i * t_1); t_3 = i * (c * t_1); tmp = 0.0; if (t_3 <= -Inf) tmp = -2.0 * t_2; elseif (t_3 <= 5e+297) tmp = 2.0 * (((x * y) + (z * t)) - 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[(i * t$95$1), $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, 5e+297], N[(2.0 * N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $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(i \cdot t_1\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 5 \cdot 10^{+297}:\\
\;\;\;\;2 \cdot \left(\left(x \cdot y + z \cdot t\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 66.4%
Taylor expanded in z around 0 87.5%
Taylor expanded in x around 0 91.4%
if -inf.0 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 4.9999999999999998e297Initial program 98.6%
if 4.9999999999999998e297 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) Initial program 80.7%
Taylor expanded in x around 0 94.6%
Final simplification96.4%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ a (* b c))) (t_2 (+ (* x y) (* z t))))
(if (<= (- t_2 (* i (* c t_1))) INFINITY)
(* 2.0 (- t_2 (* (* c i) t_1)))
(* -2.0 (* c (* i t_1))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = a + (b * c);
double t_2 = (x * y) + (z * t);
double tmp;
if ((t_2 - (i * (c * t_1))) <= ((double) INFINITY)) {
tmp = 2.0 * (t_2 - ((c * i) * t_1));
} else {
tmp = -2.0 * (c * (i * t_1));
}
return tmp;
}
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = a + (b * c);
double t_2 = (x * y) + (z * t);
double tmp;
if ((t_2 - (i * (c * t_1))) <= Double.POSITIVE_INFINITY) {
tmp = 2.0 * (t_2 - ((c * i) * t_1));
} else {
tmp = -2.0 * (c * (i * t_1));
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = a + (b * c) t_2 = (x * y) + (z * t) tmp = 0 if (t_2 - (i * (c * t_1))) <= math.inf: tmp = 2.0 * (t_2 - ((c * i) * t_1)) else: tmp = -2.0 * (c * (i * t_1)) return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(a + Float64(b * c)) t_2 = Float64(Float64(x * y) + Float64(z * t)) tmp = 0.0 if (Float64(t_2 - Float64(i * Float64(c * t_1))) <= Inf) tmp = Float64(2.0 * Float64(t_2 - Float64(Float64(c * i) * t_1))); else tmp = Float64(-2.0 * Float64(c * Float64(i * t_1))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = a + (b * c); t_2 = (x * y) + (z * t); tmp = 0.0; if ((t_2 - (i * (c * t_1))) <= Inf) tmp = 2.0 * (t_2 - ((c * i) * t_1)); else tmp = -2.0 * (c * (i * t_1)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(t$95$2 - N[(i * N[(c * t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], Infinity], N[(2.0 * N[(t$95$2 - N[(N[(c * i), $MachinePrecision] * t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(-2.0 * N[(c * N[(i * t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a + b \cdot c\\
t_2 := x \cdot y + z \cdot t\\
\mathbf{if}\;t_2 - i \cdot \left(c \cdot t_1\right) \leq \infty:\\
\;\;\;\;2 \cdot \left(t_2 - \left(c \cdot i\right) \cdot t_1\right)\\
\mathbf{else}:\\
\;\;\;\;-2 \cdot \left(c \cdot \left(i \cdot t_1\right)\right)\\
\end{array}
\end{array}
if (-.f64 (+.f64 (*.f64 x y) (*.f64 z t)) (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i)) < +inf.0Initial program 93.3%
associate--l+93.3%
*-commutative93.3%
associate--l+93.3%
associate--l+93.3%
*-commutative93.3%
associate--l+93.3%
fma-def93.3%
associate-*l*97.6%
Simplified97.6%
fma-def97.6%
+-commutative97.6%
Applied egg-rr97.6%
if +inf.0 < (-.f64 (+.f64 (*.f64 x y) (*.f64 z t)) (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i)) Initial program 0.0%
Taylor expanded in z around 0 50.0%
Taylor expanded in x around 0 75.9%
Final simplification96.6%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* 2.0 (+ (* x y) (* z t))))
(t_2 (* -2.0 (* c (* i (+ a (* b c)))))))
(if (<= c -2.5e+185)
t_2
(if (<= c -3.1e+121)
(* 2.0 (- (* x y) (* c (* b (* c i)))))
(if (<= c -1.65e+68)
t_2
(if (<= c 3.65e-286)
t_1
(if (<= c 6.2e-118)
(* 2.0 (- (* z t) (* a (* c i))))
(if (<= c 1.45e-68) 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 * ((x * y) + (z * t));
double t_2 = -2.0 * (c * (i * (a + (b * c))));
double tmp;
if (c <= -2.5e+185) {
tmp = t_2;
} else if (c <= -3.1e+121) {
tmp = 2.0 * ((x * y) - (c * (b * (c * i))));
} else if (c <= -1.65e+68) {
tmp = t_2;
} else if (c <= 3.65e-286) {
tmp = t_1;
} else if (c <= 6.2e-118) {
tmp = 2.0 * ((z * t) - (a * (c * i)));
} else if (c <= 1.45e-68) {
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 * ((x * y) + (z * t))
t_2 = (-2.0d0) * (c * (i * (a + (b * c))))
if (c <= (-2.5d+185)) then
tmp = t_2
else if (c <= (-3.1d+121)) then
tmp = 2.0d0 * ((x * y) - (c * (b * (c * i))))
else if (c <= (-1.65d+68)) then
tmp = t_2
else if (c <= 3.65d-286) then
tmp = t_1
else if (c <= 6.2d-118) then
tmp = 2.0d0 * ((z * t) - (a * (c * i)))
else if (c <= 1.45d-68) 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 * ((x * y) + (z * t));
double t_2 = -2.0 * (c * (i * (a + (b * c))));
double tmp;
if (c <= -2.5e+185) {
tmp = t_2;
} else if (c <= -3.1e+121) {
tmp = 2.0 * ((x * y) - (c * (b * (c * i))));
} else if (c <= -1.65e+68) {
tmp = t_2;
} else if (c <= 3.65e-286) {
tmp = t_1;
} else if (c <= 6.2e-118) {
tmp = 2.0 * ((z * t) - (a * (c * i)));
} else if (c <= 1.45e-68) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = 2.0 * ((x * y) + (z * t)) t_2 = -2.0 * (c * (i * (a + (b * c)))) tmp = 0 if c <= -2.5e+185: tmp = t_2 elif c <= -3.1e+121: tmp = 2.0 * ((x * y) - (c * (b * (c * i)))) elif c <= -1.65e+68: tmp = t_2 elif c <= 3.65e-286: tmp = t_1 elif c <= 6.2e-118: tmp = 2.0 * ((z * t) - (a * (c * i))) elif c <= 1.45e-68: 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(Float64(x * y) + Float64(z * t))) t_2 = Float64(-2.0 * Float64(c * Float64(i * Float64(a + Float64(b * c))))) tmp = 0.0 if (c <= -2.5e+185) tmp = t_2; elseif (c <= -3.1e+121) tmp = Float64(2.0 * Float64(Float64(x * y) - Float64(c * Float64(b * Float64(c * i))))); elseif (c <= -1.65e+68) tmp = t_2; elseif (c <= 3.65e-286) tmp = t_1; elseif (c <= 6.2e-118) tmp = Float64(2.0 * Float64(Float64(z * t) - Float64(a * Float64(c * i)))); elseif (c <= 1.45e-68) 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 * ((x * y) + (z * t)); t_2 = -2.0 * (c * (i * (a + (b * c)))); tmp = 0.0; if (c <= -2.5e+185) tmp = t_2; elseif (c <= -3.1e+121) tmp = 2.0 * ((x * y) - (c * (b * (c * i)))); elseif (c <= -1.65e+68) tmp = t_2; elseif (c <= 3.65e-286) tmp = t_1; elseif (c <= 6.2e-118) tmp = 2.0 * ((z * t) - (a * (c * i))); elseif (c <= 1.45e-68) 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[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(-2.0 * N[(c * N[(i * N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[c, -2.5e+185], t$95$2, If[LessEqual[c, -3.1e+121], N[(2.0 * N[(N[(x * y), $MachinePrecision] - N[(c * N[(b * N[(c * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[c, -1.65e+68], t$95$2, If[LessEqual[c, 3.65e-286], t$95$1, If[LessEqual[c, 6.2e-118], N[(2.0 * N[(N[(z * t), $MachinePrecision] - N[(a * N[(c * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[c, 1.45e-68], t$95$1, t$95$2]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := 2 \cdot \left(x \cdot y + z \cdot t\right)\\
t_2 := -2 \cdot \left(c \cdot \left(i \cdot \left(a + b \cdot c\right)\right)\right)\\
\mathbf{if}\;c \leq -2.5 \cdot 10^{+185}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;c \leq -3.1 \cdot 10^{+121}:\\
\;\;\;\;2 \cdot \left(x \cdot y - c \cdot \left(b \cdot \left(c \cdot i\right)\right)\right)\\
\mathbf{elif}\;c \leq -1.65 \cdot 10^{+68}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;c \leq 3.65 \cdot 10^{-286}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;c \leq 6.2 \cdot 10^{-118}:\\
\;\;\;\;2 \cdot \left(z \cdot t - a \cdot \left(c \cdot i\right)\right)\\
\mathbf{elif}\;c \leq 1.45 \cdot 10^{-68}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if c < -2.49999999999999995e185 or -3.10000000000000008e121 < c < -1.65e68 or 1.45e-68 < c Initial program 81.4%
Taylor expanded in z around 0 85.0%
Taylor expanded in x around 0 78.5%
if -2.49999999999999995e185 < c < -3.10000000000000008e121Initial program 71.1%
Taylor expanded in z around 0 73.7%
Taylor expanded in a around 0 83.3%
if -1.65e68 < c < 3.64999999999999979e-286 or 6.2000000000000002e-118 < c < 1.45e-68Initial program 98.9%
Taylor expanded in c around 0 78.9%
if 3.64999999999999979e-286 < c < 6.2000000000000002e-118Initial program 99.8%
Taylor expanded in a around inf 96.9%
*-commutative96.9%
Simplified96.9%
Taylor expanded in x around 0 77.3%
Final simplification78.8%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* c (* i (+ a (* b c))))))
(if (or (<= (* x y) -4e-106) (not (<= (* x y) 2e+16)))
(* 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 * (i * (a + (b * c)));
double tmp;
if (((x * y) <= -4e-106) || !((x * y) <= 2e+16)) {
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 * (i * (a + (b * c)))
if (((x * y) <= (-4d-106)) .or. (.not. ((x * y) <= 2d+16))) 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 * (i * (a + (b * c)));
double tmp;
if (((x * y) <= -4e-106) || !((x * y) <= 2e+16)) {
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 * (i * (a + (b * c))) tmp = 0 if ((x * y) <= -4e-106) or not ((x * y) <= 2e+16): 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(i * Float64(a + Float64(b * c)))) tmp = 0.0 if ((Float64(x * y) <= -4e-106) || !(Float64(x * y) <= 2e+16)) 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 * (i * (a + (b * c))); tmp = 0.0; if (((x * y) <= -4e-106) || ~(((x * y) <= 2e+16))) 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[(i * N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[N[(x * y), $MachinePrecision], -4e-106], N[Not[LessEqual[N[(x * y), $MachinePrecision], 2e+16]], $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(i \cdot \left(a + b \cdot c\right)\right)\\
\mathbf{if}\;x \cdot y \leq -4 \cdot 10^{-106} \lor \neg \left(x \cdot y \leq 2 \cdot 10^{+16}\right):\\
\;\;\;\;2 \cdot \left(x \cdot y - t_1\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(z \cdot t - t_1\right)\\
\end{array}
\end{array}
if (*.f64 x y) < -3.99999999999999976e-106 or 2e16 < (*.f64 x y) Initial program 86.8%
Taylor expanded in z around 0 76.5%
if -3.99999999999999976e-106 < (*.f64 x y) < 2e16Initial program 91.1%
Taylor expanded in x around 0 85.8%
Final simplification81.2%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* 2.0 (+ (* x y) (* z t))))
(t_2 (* -2.0 (* c (* i (+ a (* b c)))))))
(if (<= c -1.5e+68)
t_2
(if (<= c 3.65e-286)
t_1
(if (<= c 2.3e-116)
(* 2.0 (- (* z t) (* a (* c i))))
(if (<= c 1.25e-68) 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 * ((x * y) + (z * t));
double t_2 = -2.0 * (c * (i * (a + (b * c))));
double tmp;
if (c <= -1.5e+68) {
tmp = t_2;
} else if (c <= 3.65e-286) {
tmp = t_1;
} else if (c <= 2.3e-116) {
tmp = 2.0 * ((z * t) - (a * (c * i)));
} else if (c <= 1.25e-68) {
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 * ((x * y) + (z * t))
t_2 = (-2.0d0) * (c * (i * (a + (b * c))))
if (c <= (-1.5d+68)) then
tmp = t_2
else if (c <= 3.65d-286) then
tmp = t_1
else if (c <= 2.3d-116) then
tmp = 2.0d0 * ((z * t) - (a * (c * i)))
else if (c <= 1.25d-68) 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 * ((x * y) + (z * t));
double t_2 = -2.0 * (c * (i * (a + (b * c))));
double tmp;
if (c <= -1.5e+68) {
tmp = t_2;
} else if (c <= 3.65e-286) {
tmp = t_1;
} else if (c <= 2.3e-116) {
tmp = 2.0 * ((z * t) - (a * (c * i)));
} else if (c <= 1.25e-68) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = 2.0 * ((x * y) + (z * t)) t_2 = -2.0 * (c * (i * (a + (b * c)))) tmp = 0 if c <= -1.5e+68: tmp = t_2 elif c <= 3.65e-286: tmp = t_1 elif c <= 2.3e-116: tmp = 2.0 * ((z * t) - (a * (c * i))) elif c <= 1.25e-68: 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(Float64(x * y) + Float64(z * t))) t_2 = Float64(-2.0 * Float64(c * Float64(i * Float64(a + Float64(b * c))))) tmp = 0.0 if (c <= -1.5e+68) tmp = t_2; elseif (c <= 3.65e-286) tmp = t_1; elseif (c <= 2.3e-116) tmp = Float64(2.0 * Float64(Float64(z * t) - Float64(a * Float64(c * i)))); elseif (c <= 1.25e-68) 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 * ((x * y) + (z * t)); t_2 = -2.0 * (c * (i * (a + (b * c)))); tmp = 0.0; if (c <= -1.5e+68) tmp = t_2; elseif (c <= 3.65e-286) tmp = t_1; elseif (c <= 2.3e-116) tmp = 2.0 * ((z * t) - (a * (c * i))); elseif (c <= 1.25e-68) 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[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(-2.0 * N[(c * N[(i * N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[c, -1.5e+68], t$95$2, If[LessEqual[c, 3.65e-286], t$95$1, If[LessEqual[c, 2.3e-116], N[(2.0 * N[(N[(z * t), $MachinePrecision] - N[(a * N[(c * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[c, 1.25e-68], t$95$1, t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := 2 \cdot \left(x \cdot y + z \cdot t\right)\\
t_2 := -2 \cdot \left(c \cdot \left(i \cdot \left(a + b \cdot c\right)\right)\right)\\
\mathbf{if}\;c \leq -1.5 \cdot 10^{+68}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;c \leq 3.65 \cdot 10^{-286}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;c \leq 2.3 \cdot 10^{-116}:\\
\;\;\;\;2 \cdot \left(z \cdot t - a \cdot \left(c \cdot i\right)\right)\\
\mathbf{elif}\;c \leq 1.25 \cdot 10^{-68}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if c < -1.5000000000000001e68 or 1.24999999999999993e-68 < c Initial program 79.9%
Taylor expanded in z around 0 83.4%
Taylor expanded in x around 0 76.0%
if -1.5000000000000001e68 < c < 3.64999999999999979e-286 or 2.30000000000000002e-116 < c < 1.24999999999999993e-68Initial program 98.9%
Taylor expanded in c around 0 78.9%
if 3.64999999999999979e-286 < c < 2.30000000000000002e-116Initial program 99.8%
Taylor expanded in a around inf 96.9%
*-commutative96.9%
Simplified96.9%
Taylor expanded in x around 0 77.3%
Final simplification77.1%
(FPCore (x y z t a b c i)
:precision binary64
(if (<= y -1.08e+23)
(* 2.0 (+ (* x y) (* z t)))
(if (<= y 4.2e+139)
(* 2.0 (- (* z t) (* c (* i (+ a (* b c))))))
(* 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 (y <= -1.08e+23) {
tmp = 2.0 * ((x * y) + (z * t));
} else if (y <= 4.2e+139) {
tmp = 2.0 * ((z * t) - (c * (i * (a + (b * c)))));
} 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 (y <= (-1.08d+23)) then
tmp = 2.0d0 * ((x * y) + (z * t))
else if (y <= 4.2d+139) then
tmp = 2.0d0 * ((z * t) - (c * (i * (a + (b * c)))))
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 (y <= -1.08e+23) {
tmp = 2.0 * ((x * y) + (z * t));
} else if (y <= 4.2e+139) {
tmp = 2.0 * ((z * t) - (c * (i * (a + (b * c)))));
} 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 y <= -1.08e+23: tmp = 2.0 * ((x * y) + (z * t)) elif y <= 4.2e+139: tmp = 2.0 * ((z * t) - (c * (i * (a + (b * c))))) 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 (y <= -1.08e+23) tmp = Float64(2.0 * Float64(Float64(x * y) + Float64(z * t))); elseif (y <= 4.2e+139) tmp = Float64(2.0 * Float64(Float64(z * t) - Float64(c * Float64(i * Float64(a + Float64(b * c)))))); 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 (y <= -1.08e+23) tmp = 2.0 * ((x * y) + (z * t)); elseif (y <= 4.2e+139) tmp = 2.0 * ((z * t) - (c * (i * (a + (b * c))))); 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[y, -1.08e+23], N[(2.0 * N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 4.2e+139], N[(2.0 * N[(N[(z * t), $MachinePrecision] - N[(c * N[(i * N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision]), $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}\;y \leq -1.08 \cdot 10^{+23}:\\
\;\;\;\;2 \cdot \left(x \cdot y + z \cdot t\right)\\
\mathbf{elif}\;y \leq 4.2 \cdot 10^{+139}:\\
\;\;\;\;2 \cdot \left(z \cdot t - c \cdot \left(i \cdot \left(a + b \cdot c\right)\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 y < -1.0800000000000001e23Initial program 86.4%
Taylor expanded in c around 0 59.3%
if -1.0800000000000001e23 < y < 4.1999999999999997e139Initial program 89.0%
Taylor expanded in x around 0 79.6%
if 4.1999999999999997e139 < y Initial program 92.1%
Taylor expanded in z around 0 79.2%
Taylor expanded in a around 0 71.6%
expm1-log1p-u50.3%
expm1-udef50.3%
*-commutative50.3%
*-commutative50.3%
associate-*r*50.3%
*-commutative50.3%
associate-*r*50.3%
Applied egg-rr50.3%
expm1-def50.3%
expm1-log1p74.0%
*-commutative74.0%
*-commutative74.0%
Simplified74.0%
Final simplification74.7%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* c (* i (+ a (* b c))))))
(if (<= c -1.12e-9)
(* 2.0 (- (* z t) t_1))
(if (<= c 1.3e-51)
(* 2.0 (- (+ (* x y) (* z t)) (* i (* c a))))
(* 2.0 (- (* x y) t_1))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = c * (i * (a + (b * c)));
double tmp;
if (c <= -1.12e-9) {
tmp = 2.0 * ((z * t) - t_1);
} else if (c <= 1.3e-51) {
tmp = 2.0 * (((x * y) + (z * t)) - (i * (c * a)));
} else {
tmp = 2.0 * ((x * y) - 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 * (i * (a + (b * c)))
if (c <= (-1.12d-9)) then
tmp = 2.0d0 * ((z * t) - t_1)
else if (c <= 1.3d-51) then
tmp = 2.0d0 * (((x * y) + (z * t)) - (i * (c * a)))
else
tmp = 2.0d0 * ((x * y) - 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 * (i * (a + (b * c)));
double tmp;
if (c <= -1.12e-9) {
tmp = 2.0 * ((z * t) - t_1);
} else if (c <= 1.3e-51) {
tmp = 2.0 * (((x * y) + (z * t)) - (i * (c * a)));
} else {
tmp = 2.0 * ((x * y) - t_1);
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = c * (i * (a + (b * c))) tmp = 0 if c <= -1.12e-9: tmp = 2.0 * ((z * t) - t_1) elif c <= 1.3e-51: tmp = 2.0 * (((x * y) + (z * t)) - (i * (c * a))) else: tmp = 2.0 * ((x * y) - t_1) return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(c * Float64(i * Float64(a + Float64(b * c)))) tmp = 0.0 if (c <= -1.12e-9) tmp = Float64(2.0 * Float64(Float64(z * t) - t_1)); elseif (c <= 1.3e-51) tmp = Float64(2.0 * Float64(Float64(Float64(x * y) + Float64(z * t)) - Float64(i * Float64(c * a)))); else tmp = Float64(2.0 * Float64(Float64(x * y) - t_1)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = c * (i * (a + (b * c))); tmp = 0.0; if (c <= -1.12e-9) tmp = 2.0 * ((z * t) - t_1); elseif (c <= 1.3e-51) tmp = 2.0 * (((x * y) + (z * t)) - (i * (c * a))); else tmp = 2.0 * ((x * y) - t_1); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(c * N[(i * N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[c, -1.12e-9], N[(2.0 * N[(N[(z * t), $MachinePrecision] - t$95$1), $MachinePrecision]), $MachinePrecision], If[LessEqual[c, 1.3e-51], N[(2.0 * N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] - N[(i * N[(c * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[(x * y), $MachinePrecision] - t$95$1), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := c \cdot \left(i \cdot \left(a + b \cdot c\right)\right)\\
\mathbf{if}\;c \leq -1.12 \cdot 10^{-9}:\\
\;\;\;\;2 \cdot \left(z \cdot t - t_1\right)\\
\mathbf{elif}\;c \leq 1.3 \cdot 10^{-51}:\\
\;\;\;\;2 \cdot \left(\left(x \cdot y + z \cdot t\right) - i \cdot \left(c \cdot a\right)\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(x \cdot y - t_1\right)\\
\end{array}
\end{array}
if c < -1.12000000000000006e-9Initial program 76.7%
Taylor expanded in x around 0 83.4%
if -1.12000000000000006e-9 < c < 1.3e-51Initial program 99.9%
Taylor expanded in a around inf 96.1%
*-commutative96.1%
Simplified96.1%
if 1.3e-51 < c Initial program 85.8%
Taylor expanded in z around 0 86.3%
Final simplification89.6%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* 2.0 (* z t))) (t_2 (* -2.0 (* a (* c i)))))
(if (<= i -1.8e-107)
t_2
(if (<= i 5e-273)
t_1
(if (<= i 3e-162)
(* 2.0 (* x y))
(if (<= i 6.6e+49)
t_1
(if (<= i 3.8e+273) t_2 (* i (* a (* 2.0 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);
double t_2 = -2.0 * (a * (c * i));
double tmp;
if (i <= -1.8e-107) {
tmp = t_2;
} else if (i <= 5e-273) {
tmp = t_1;
} else if (i <= 3e-162) {
tmp = 2.0 * (x * y);
} else if (i <= 6.6e+49) {
tmp = t_1;
} else if (i <= 3.8e+273) {
tmp = t_2;
} else {
tmp = i * (a * (2.0 * 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 * (z * t)
t_2 = (-2.0d0) * (a * (c * i))
if (i <= (-1.8d-107)) then
tmp = t_2
else if (i <= 5d-273) then
tmp = t_1
else if (i <= 3d-162) then
tmp = 2.0d0 * (x * y)
else if (i <= 6.6d+49) then
tmp = t_1
else if (i <= 3.8d+273) then
tmp = t_2
else
tmp = i * (a * (2.0d0 * 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);
double t_2 = -2.0 * (a * (c * i));
double tmp;
if (i <= -1.8e-107) {
tmp = t_2;
} else if (i <= 5e-273) {
tmp = t_1;
} else if (i <= 3e-162) {
tmp = 2.0 * (x * y);
} else if (i <= 6.6e+49) {
tmp = t_1;
} else if (i <= 3.8e+273) {
tmp = t_2;
} else {
tmp = i * (a * (2.0 * c));
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = 2.0 * (z * t) t_2 = -2.0 * (a * (c * i)) tmp = 0 if i <= -1.8e-107: tmp = t_2 elif i <= 5e-273: tmp = t_1 elif i <= 3e-162: tmp = 2.0 * (x * y) elif i <= 6.6e+49: tmp = t_1 elif i <= 3.8e+273: tmp = t_2 else: tmp = i * (a * (2.0 * c)) 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(a * Float64(c * i))) tmp = 0.0 if (i <= -1.8e-107) tmp = t_2; elseif (i <= 5e-273) tmp = t_1; elseif (i <= 3e-162) tmp = Float64(2.0 * Float64(x * y)); elseif (i <= 6.6e+49) tmp = t_1; elseif (i <= 3.8e+273) tmp = t_2; else tmp = Float64(i * Float64(a * Float64(2.0 * c))); 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 * (a * (c * i)); tmp = 0.0; if (i <= -1.8e-107) tmp = t_2; elseif (i <= 5e-273) tmp = t_1; elseif (i <= 3e-162) tmp = 2.0 * (x * y); elseif (i <= 6.6e+49) tmp = t_1; elseif (i <= 3.8e+273) tmp = t_2; else tmp = i * (a * (2.0 * c)); 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[(a * N[(c * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[i, -1.8e-107], t$95$2, If[LessEqual[i, 5e-273], t$95$1, If[LessEqual[i, 3e-162], N[(2.0 * N[(x * y), $MachinePrecision]), $MachinePrecision], If[LessEqual[i, 6.6e+49], t$95$1, If[LessEqual[i, 3.8e+273], t$95$2, N[(i * N[(a * N[(2.0 * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := 2 \cdot \left(z \cdot t\right)\\
t_2 := -2 \cdot \left(a \cdot \left(c \cdot i\right)\right)\\
\mathbf{if}\;i \leq -1.8 \cdot 10^{-107}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;i \leq 5 \cdot 10^{-273}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;i \leq 3 \cdot 10^{-162}:\\
\;\;\;\;2 \cdot \left(x \cdot y\right)\\
\mathbf{elif}\;i \leq 6.6 \cdot 10^{+49}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;i \leq 3.8 \cdot 10^{+273}:\\
\;\;\;\;t_2\\
\mathbf{else}:\\
\;\;\;\;i \cdot \left(a \cdot \left(2 \cdot c\right)\right)\\
\end{array}
\end{array}
if i < -1.79999999999999988e-107 or 6.5999999999999997e49 < i < 3.8e273Initial program 92.9%
Taylor expanded in z around 0 76.1%
Taylor expanded in a around inf 44.5%
if -1.79999999999999988e-107 < i < 4.99999999999999965e-273 or 2.99999999999999999e-162 < i < 6.5999999999999997e49Initial program 85.6%
Taylor expanded in z around inf 44.8%
if 4.99999999999999965e-273 < i < 2.99999999999999999e-162Initial program 80.0%
Taylor expanded in x around inf 57.9%
if 3.8e273 < i Initial program 87.5%
associate--l+87.5%
*-commutative87.5%
associate--l+87.5%
associate--l+87.5%
*-commutative87.5%
associate--l+87.5%
fma-def87.5%
associate-*l*75.8%
Simplified75.8%
fma-def75.8%
+-commutative75.8%
Applied egg-rr75.8%
Taylor expanded in a around inf 0.9%
mul-1-neg0.9%
associate-*r*1.5%
distribute-rgt-neg-out1.5%
*-commutative1.5%
*-commutative1.5%
Simplified1.5%
expm1-log1p-u1.4%
expm1-udef1.4%
*-commutative1.4%
add-sqr-sqrt0.0%
sqrt-unprod37.5%
sqr-neg37.5%
sqrt-unprod26.1%
add-sqr-sqrt26.1%
*-commutative26.1%
associate-*r*26.1%
Applied egg-rr26.1%
expm1-def26.2%
expm1-log1p51.8%
associate-*l*51.8%
associate-*l*51.7%
Simplified51.7%
Final simplification46.4%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* 2.0 (* z t))) (t_2 (* -2.0 (* a (* c i)))))
(if (<= i -4.8e-119)
t_2
(if (<= i 1.9e-276)
t_1
(if (<= i 1.12e-164)
(* 2.0 (* x y))
(if (<= i 1.5e+49)
t_1
(if (<= i 3.8e+273) t_2 (* (* a i) (* 2.0 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);
double t_2 = -2.0 * (a * (c * i));
double tmp;
if (i <= -4.8e-119) {
tmp = t_2;
} else if (i <= 1.9e-276) {
tmp = t_1;
} else if (i <= 1.12e-164) {
tmp = 2.0 * (x * y);
} else if (i <= 1.5e+49) {
tmp = t_1;
} else if (i <= 3.8e+273) {
tmp = t_2;
} else {
tmp = (a * i) * (2.0 * 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 * (z * t)
t_2 = (-2.0d0) * (a * (c * i))
if (i <= (-4.8d-119)) then
tmp = t_2
else if (i <= 1.9d-276) then
tmp = t_1
else if (i <= 1.12d-164) then
tmp = 2.0d0 * (x * y)
else if (i <= 1.5d+49) then
tmp = t_1
else if (i <= 3.8d+273) then
tmp = t_2
else
tmp = (a * i) * (2.0d0 * 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);
double t_2 = -2.0 * (a * (c * i));
double tmp;
if (i <= -4.8e-119) {
tmp = t_2;
} else if (i <= 1.9e-276) {
tmp = t_1;
} else if (i <= 1.12e-164) {
tmp = 2.0 * (x * y);
} else if (i <= 1.5e+49) {
tmp = t_1;
} else if (i <= 3.8e+273) {
tmp = t_2;
} else {
tmp = (a * i) * (2.0 * c);
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = 2.0 * (z * t) t_2 = -2.0 * (a * (c * i)) tmp = 0 if i <= -4.8e-119: tmp = t_2 elif i <= 1.9e-276: tmp = t_1 elif i <= 1.12e-164: tmp = 2.0 * (x * y) elif i <= 1.5e+49: tmp = t_1 elif i <= 3.8e+273: tmp = t_2 else: tmp = (a * i) * (2.0 * c) 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(a * Float64(c * i))) tmp = 0.0 if (i <= -4.8e-119) tmp = t_2; elseif (i <= 1.9e-276) tmp = t_1; elseif (i <= 1.12e-164) tmp = Float64(2.0 * Float64(x * y)); elseif (i <= 1.5e+49) tmp = t_1; elseif (i <= 3.8e+273) tmp = t_2; else tmp = Float64(Float64(a * i) * Float64(2.0 * c)); 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 * (a * (c * i)); tmp = 0.0; if (i <= -4.8e-119) tmp = t_2; elseif (i <= 1.9e-276) tmp = t_1; elseif (i <= 1.12e-164) tmp = 2.0 * (x * y); elseif (i <= 1.5e+49) tmp = t_1; elseif (i <= 3.8e+273) tmp = t_2; else tmp = (a * i) * (2.0 * c); 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[(a * N[(c * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[i, -4.8e-119], t$95$2, If[LessEqual[i, 1.9e-276], t$95$1, If[LessEqual[i, 1.12e-164], N[(2.0 * N[(x * y), $MachinePrecision]), $MachinePrecision], If[LessEqual[i, 1.5e+49], t$95$1, If[LessEqual[i, 3.8e+273], t$95$2, N[(N[(a * i), $MachinePrecision] * N[(2.0 * c), $MachinePrecision]), $MachinePrecision]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := 2 \cdot \left(z \cdot t\right)\\
t_2 := -2 \cdot \left(a \cdot \left(c \cdot i\right)\right)\\
\mathbf{if}\;i \leq -4.8 \cdot 10^{-119}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;i \leq 1.9 \cdot 10^{-276}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;i \leq 1.12 \cdot 10^{-164}:\\
\;\;\;\;2 \cdot \left(x \cdot y\right)\\
\mathbf{elif}\;i \leq 1.5 \cdot 10^{+49}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;i \leq 3.8 \cdot 10^{+273}:\\
\;\;\;\;t_2\\
\mathbf{else}:\\
\;\;\;\;\left(a \cdot i\right) \cdot \left(2 \cdot c\right)\\
\end{array}
\end{array}
if i < -4.80000000000000017e-119 or 1.5000000000000001e49 < i < 3.8e273Initial program 92.9%
Taylor expanded in z around 0 76.1%
Taylor expanded in a around inf 44.5%
if -4.80000000000000017e-119 < i < 1.9e-276 or 1.12e-164 < i < 1.5000000000000001e49Initial program 85.6%
Taylor expanded in z around inf 44.8%
if 1.9e-276 < i < 1.12e-164Initial program 80.0%
Taylor expanded in x around inf 57.9%
if 3.8e273 < i Initial program 87.5%
associate--l+87.5%
*-commutative87.5%
associate--l+87.5%
associate--l+87.5%
*-commutative87.5%
associate--l+87.5%
fma-def87.5%
associate-*l*75.8%
Simplified75.8%
fma-def75.8%
+-commutative75.8%
Applied egg-rr75.8%
Taylor expanded in a around inf 0.9%
mul-1-neg0.9%
associate-*r*1.5%
distribute-rgt-neg-out1.5%
*-commutative1.5%
*-commutative1.5%
Simplified1.5%
expm1-log1p-u1.4%
expm1-udef1.4%
*-commutative1.4%
add-sqr-sqrt0.0%
sqrt-unprod37.5%
sqr-neg37.5%
sqrt-unprod26.1%
add-sqr-sqrt26.1%
*-commutative26.1%
associate-*r*26.1%
Applied egg-rr26.1%
expm1-def26.2%
expm1-log1p51.8%
associate-*l*51.8%
Simplified51.8%
Final simplification46.4%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* 2.0 (* z t))) (t_2 (* -2.0 (* a (* c i)))))
(if (<= i -9.5e-104)
t_2
(if (<= i 4.5e-275)
t_1
(if (<= i 7.2e-163) (* 2.0 (* x y)) (if (<= i 4.8e+49) 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 * (a * (c * i));
double tmp;
if (i <= -9.5e-104) {
tmp = t_2;
} else if (i <= 4.5e-275) {
tmp = t_1;
} else if (i <= 7.2e-163) {
tmp = 2.0 * (x * y);
} else if (i <= 4.8e+49) {
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) * (a * (c * i))
if (i <= (-9.5d-104)) then
tmp = t_2
else if (i <= 4.5d-275) then
tmp = t_1
else if (i <= 7.2d-163) then
tmp = 2.0d0 * (x * y)
else if (i <= 4.8d+49) 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 * (a * (c * i));
double tmp;
if (i <= -9.5e-104) {
tmp = t_2;
} else if (i <= 4.5e-275) {
tmp = t_1;
} else if (i <= 7.2e-163) {
tmp = 2.0 * (x * y);
} else if (i <= 4.8e+49) {
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 * (a * (c * i)) tmp = 0 if i <= -9.5e-104: tmp = t_2 elif i <= 4.5e-275: tmp = t_1 elif i <= 7.2e-163: tmp = 2.0 * (x * y) elif i <= 4.8e+49: 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(a * Float64(c * i))) tmp = 0.0 if (i <= -9.5e-104) tmp = t_2; elseif (i <= 4.5e-275) tmp = t_1; elseif (i <= 7.2e-163) tmp = Float64(2.0 * Float64(x * y)); elseif (i <= 4.8e+49) 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 * (a * (c * i)); tmp = 0.0; if (i <= -9.5e-104) tmp = t_2; elseif (i <= 4.5e-275) tmp = t_1; elseif (i <= 7.2e-163) tmp = 2.0 * (x * y); elseif (i <= 4.8e+49) 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[(a * N[(c * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[i, -9.5e-104], t$95$2, If[LessEqual[i, 4.5e-275], t$95$1, If[LessEqual[i, 7.2e-163], N[(2.0 * N[(x * y), $MachinePrecision]), $MachinePrecision], If[LessEqual[i, 4.8e+49], 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(a \cdot \left(c \cdot i\right)\right)\\
\mathbf{if}\;i \leq -9.5 \cdot 10^{-104}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;i \leq 4.5 \cdot 10^{-275}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;i \leq 7.2 \cdot 10^{-163}:\\
\;\;\;\;2 \cdot \left(x \cdot y\right)\\
\mathbf{elif}\;i \leq 4.8 \cdot 10^{+49}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if i < -9.5000000000000002e-104 or 4.8e49 < i Initial program 92.6%
Taylor expanded in z around 0 76.1%
Taylor expanded in a around inf 42.2%
if -9.5000000000000002e-104 < i < 4.49999999999999978e-275 or 7.1999999999999996e-163 < i < 4.8e49Initial program 85.6%
Taylor expanded in z around inf 44.8%
if 4.49999999999999978e-275 < i < 7.1999999999999996e-163Initial program 80.0%
Taylor expanded in x around inf 57.9%
Final simplification44.8%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= c -4.8e+67) (not (<= c 1.45e-68))) (* -2.0 (* c (* i (+ a (* b c))))) (* 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 <= -4.8e+67) || !(c <= 1.45e-68)) {
tmp = -2.0 * (c * (i * (a + (b * c))));
} 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 <= (-4.8d+67)) .or. (.not. (c <= 1.45d-68))) then
tmp = (-2.0d0) * (c * (i * (a + (b * c))))
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 <= -4.8e+67) || !(c <= 1.45e-68)) {
tmp = -2.0 * (c * (i * (a + (b * c))));
} else {
tmp = 2.0 * ((x * y) + (z * t));
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if (c <= -4.8e+67) or not (c <= 1.45e-68): tmp = -2.0 * (c * (i * (a + (b * c)))) 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 <= -4.8e+67) || !(c <= 1.45e-68)) tmp = Float64(-2.0 * Float64(c * Float64(i * Float64(a + Float64(b * c))))); 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 <= -4.8e+67) || ~((c <= 1.45e-68))) tmp = -2.0 * (c * (i * (a + (b * c)))); 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, -4.8e+67], N[Not[LessEqual[c, 1.45e-68]], $MachinePrecision]], N[(-2.0 * N[(c * N[(i * N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;c \leq -4.8 \cdot 10^{+67} \lor \neg \left(c \leq 1.45 \cdot 10^{-68}\right):\\
\;\;\;\;-2 \cdot \left(c \cdot \left(i \cdot \left(a + b \cdot c\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(x \cdot y + z \cdot t\right)\\
\end{array}
\end{array}
if c < -4.80000000000000004e67 or 1.45e-68 < c Initial program 79.9%
Taylor expanded in z around 0 83.4%
Taylor expanded in x around 0 76.0%
if -4.80000000000000004e67 < c < 1.45e-68Initial program 99.1%
Taylor expanded in c around 0 74.2%
Final simplification75.1%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= (* x y) -5e+39) (not (<= (* x y) 1e+60))) (* 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 (((x * y) <= -5e+39) || !((x * y) <= 1e+60)) {
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 (((x * y) <= (-5d+39)) .or. (.not. ((x * y) <= 1d+60))) 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 (((x * y) <= -5e+39) || !((x * y) <= 1e+60)) {
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 ((x * y) <= -5e+39) or not ((x * y) <= 1e+60): 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 ((Float64(x * y) <= -5e+39) || !(Float64(x * y) <= 1e+60)) 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 (((x * y) <= -5e+39) || ~(((x * y) <= 1e+60))) 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[N[(x * y), $MachinePrecision], -5e+39], N[Not[LessEqual[N[(x * y), $MachinePrecision], 1e+60]], $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}\;x \cdot y \leq -5 \cdot 10^{+39} \lor \neg \left(x \cdot y \leq 10^{+60}\right):\\
\;\;\;\;2 \cdot \left(x \cdot y\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(z \cdot t\right)\\
\end{array}
\end{array}
if (*.f64 x y) < -5.00000000000000015e39 or 9.9999999999999995e59 < (*.f64 x y) Initial program 85.5%
Taylor expanded in x around inf 50.7%
if -5.00000000000000015e39 < (*.f64 x y) < 9.9999999999999995e59Initial program 91.2%
Taylor expanded in z around inf 33.0%
Final simplification40.0%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= c -3.1e+182) (not (<= c 8.6e+51))) (* -2.0 (* a (* c i))) (* 2.0 (+ (* x y) (* z t)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((c <= -3.1e+182) || !(c <= 8.6e+51)) {
tmp = -2.0 * (a * (c * i));
} else {
tmp = 2.0 * ((x * y) + (z * t));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: tmp
if ((c <= (-3.1d+182)) .or. (.not. (c <= 8.6d+51))) then
tmp = (-2.0d0) * (a * (c * i))
else
tmp = 2.0d0 * ((x * y) + (z * t))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((c <= -3.1e+182) || !(c <= 8.6e+51)) {
tmp = -2.0 * (a * (c * i));
} else {
tmp = 2.0 * ((x * y) + (z * t));
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if (c <= -3.1e+182) or not (c <= 8.6e+51): tmp = -2.0 * (a * (c * i)) else: tmp = 2.0 * ((x * y) + (z * t)) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if ((c <= -3.1e+182) || !(c <= 8.6e+51)) tmp = Float64(-2.0 * Float64(a * Float64(c * i))); else tmp = Float64(2.0 * Float64(Float64(x * y) + Float64(z * t))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if ((c <= -3.1e+182) || ~((c <= 8.6e+51))) tmp = -2.0 * (a * (c * i)); else tmp = 2.0 * ((x * y) + (z * t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[c, -3.1e+182], N[Not[LessEqual[c, 8.6e+51]], $MachinePrecision]], N[(-2.0 * N[(a * N[(c * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;c \leq -3.1 \cdot 10^{+182} \lor \neg \left(c \leq 8.6 \cdot 10^{+51}\right):\\
\;\;\;\;-2 \cdot \left(a \cdot \left(c \cdot i\right)\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(x \cdot y + z \cdot t\right)\\
\end{array}
\end{array}
if c < -3.09999999999999996e182 or 8.5999999999999994e51 < c Initial program 79.4%
Taylor expanded in z around 0 89.9%
Taylor expanded in a around inf 39.8%
if -3.09999999999999996e182 < c < 8.5999999999999994e51Initial program 92.9%
Taylor expanded in c around 0 61.3%
Final simplification55.0%
(FPCore (x y z t a b c i) :precision binary64 (* 2.0 (* z t)))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return 2.0 * (z * t);
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
code = 2.0d0 * (z * t)
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return 2.0 * (z * t);
}
def code(x, y, z, t, a, b, c, i): return 2.0 * (z * t)
function code(x, y, z, t, a, b, c, i) return Float64(2.0 * Float64(z * t)) end
function tmp = code(x, y, z, t, a, b, c, i) tmp = 2.0 * (z * t); end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(2.0 * N[(z * t), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
2 \cdot \left(z \cdot t\right)
\end{array}
Initial program 89.0%
Taylor expanded in z around inf 25.6%
Final simplification25.6%
(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 2023326
(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))))