
(FPCore (x y z t a b c i) :precision binary64 (* 2.0 (- (+ (* x y) (* z t)) (* (* (+ a (* b c)) c) i))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return 2.0 * (((x * y) + (z * t)) - (((a + (b * c)) * c) * i));
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
code = 2.0d0 * (((x * y) + (z * t)) - (((a + (b * c)) * c) * i))
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return 2.0 * (((x * y) + (z * t)) - (((a + (b * c)) * c) * i));
}
def code(x, y, z, t, a, b, c, i): return 2.0 * (((x * y) + (z * t)) - (((a + (b * c)) * c) * i))
function code(x, y, z, t, a, b, c, i) return Float64(2.0 * Float64(Float64(Float64(x * y) + Float64(z * t)) - Float64(Float64(Float64(a + Float64(b * c)) * c) * i))) end
function tmp = code(x, y, z, t, a, b, c, i) tmp = 2.0 * (((x * y) + (z * t)) - (((a + (b * c)) * c) * i)); end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(2.0 * N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] - N[(N[(N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision] * c), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
2 \cdot \left(\left(x \cdot y + z \cdot t\right) - \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i\right)
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 14 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a b c i) :precision binary64 (* 2.0 (- (+ (* x y) (* z t)) (* (* (+ a (* b c)) c) i))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return 2.0 * (((x * y) + (z * t)) - (((a + (b * c)) * c) * i));
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
code = 2.0d0 * (((x * y) + (z * t)) - (((a + (b * c)) * c) * i))
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return 2.0 * (((x * y) + (z * t)) - (((a + (b * c)) * c) * i));
}
def code(x, y, z, t, a, b, c, i): return 2.0 * (((x * y) + (z * t)) - (((a + (b * c)) * c) * i))
function code(x, y, z, t, a, b, c, i) return Float64(2.0 * Float64(Float64(Float64(x * y) + Float64(z * t)) - Float64(Float64(Float64(a + Float64(b * c)) * c) * i))) end
function tmp = code(x, y, z, t, a, b, c, i) tmp = 2.0 * (((x * y) + (z * t)) - (((a + (b * c)) * c) * i)); end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(2.0 * N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] - N[(N[(N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision] * c), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
2 \cdot \left(\left(x \cdot y + z \cdot t\right) - \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i\right)
\end{array}
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ a (* b c))))
(if (<= (- (+ (* x y) (* z t)) (* (* c t_1) i)) INFINITY)
(* 2.0 (- (fma x y (* z t)) (* t_1 (* c i))))
(* -2.0 (* c (* t_1 i))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = a + (b * c);
double tmp;
if ((((x * y) + (z * t)) - ((c * t_1) * i)) <= ((double) INFINITY)) {
tmp = 2.0 * (fma(x, y, (z * t)) - (t_1 * (c * i)));
} else {
tmp = -2.0 * (c * (t_1 * i));
}
return tmp;
}
function code(x, y, z, t, a, b, c, i) t_1 = Float64(a + Float64(b * c)) tmp = 0.0 if (Float64(Float64(Float64(x * y) + Float64(z * t)) - Float64(Float64(c * t_1) * i)) <= Inf) tmp = Float64(2.0 * Float64(fma(x, y, Float64(z * t)) - Float64(t_1 * Float64(c * i)))); else tmp = Float64(-2.0 * Float64(c * Float64(t_1 * i))); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] - N[(N[(c * t$95$1), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision], Infinity], N[(2.0 * N[(N[(x * y + N[(z * t), $MachinePrecision]), $MachinePrecision] - N[(t$95$1 * N[(c * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(-2.0 * N[(c * N[(t$95$1 * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a + b \cdot c\\
\mathbf{if}\;\left(x \cdot y + z \cdot t\right) - \left(c \cdot t_1\right) \cdot i \leq \infty:\\
\;\;\;\;2 \cdot \left(\mathsf{fma}\left(x, y, z \cdot t\right) - t_1 \cdot \left(c \cdot i\right)\right)\\
\mathbf{else}:\\
\;\;\;\;-2 \cdot \left(c \cdot \left(t_1 \cdot i\right)\right)\\
\end{array}
\end{array}
if (-.f64 (+.f64 (*.f64 x y) (*.f64 z t)) (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i)) < +inf.0Initial program 95.9%
associate--l+95.9%
*-commutative95.9%
associate--l+95.9%
associate--l+95.9%
*-commutative95.9%
associate--l+95.9%
fma-def95.9%
associate-*l*98.7%
Simplified98.7%
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 i around inf 71.5%
Taylor expanded in i around 0 71.5%
Final simplification97.3%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ a (* b c))) (t_2 (* (* c t_1) i)))
(if (<= t_2 (- INFINITY))
(* -2.0 (* c (* t_1 i)))
(if (<= t_2 1e+269)
(* 2.0 (- (+ (* x y) (* z t)) (+ (* (* b c) (* c i)) (* a (* c i)))))
(* 2.0 (- (* z t) (* (* c i) (fma b c a))))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = a + (b * c);
double t_2 = (c * t_1) * i;
double tmp;
if (t_2 <= -((double) INFINITY)) {
tmp = -2.0 * (c * (t_1 * i));
} else if (t_2 <= 1e+269) {
tmp = 2.0 * (((x * y) + (z * t)) - (((b * c) * (c * i)) + (a * (c * i))));
} else {
tmp = 2.0 * ((z * t) - ((c * i) * fma(b, c, a)));
}
return tmp;
}
function code(x, y, z, t, a, b, c, i) t_1 = Float64(a + Float64(b * c)) t_2 = Float64(Float64(c * t_1) * i) tmp = 0.0 if (t_2 <= Float64(-Inf)) tmp = Float64(-2.0 * Float64(c * Float64(t_1 * i))); elseif (t_2 <= 1e+269) tmp = Float64(2.0 * Float64(Float64(Float64(x * y) + Float64(z * t)) - Float64(Float64(Float64(b * c) * Float64(c * i)) + Float64(a * Float64(c * i))))); else tmp = Float64(2.0 * Float64(Float64(z * t) - Float64(Float64(c * i) * fma(b, c, a)))); end return 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[(c * t$95$1), $MachinePrecision] * i), $MachinePrecision]}, If[LessEqual[t$95$2, (-Infinity)], N[(-2.0 * N[(c * N[(t$95$1 * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, 1e+269], N[(2.0 * N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] - N[(N[(N[(b * c), $MachinePrecision] * N[(c * i), $MachinePrecision]), $MachinePrecision] + N[(a * N[(c * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[(z * t), $MachinePrecision] - N[(N[(c * i), $MachinePrecision] * N[(b * c + a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a + b \cdot c\\
t_2 := \left(c \cdot t_1\right) \cdot i\\
\mathbf{if}\;t_2 \leq -\infty:\\
\;\;\;\;-2 \cdot \left(c \cdot \left(t_1 \cdot i\right)\right)\\
\mathbf{elif}\;t_2 \leq 10^{+269}:\\
\;\;\;\;2 \cdot \left(\left(x \cdot y + z \cdot t\right) - \left(\left(b \cdot c\right) \cdot \left(c \cdot i\right) + a \cdot \left(c \cdot i\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(z \cdot t - \left(c \cdot i\right) \cdot \mathsf{fma}\left(b, c, a\right)\right)\\
\end{array}
\end{array}
if (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < -inf.0Initial program 72.9%
Taylor expanded in i around inf 89.7%
Taylor expanded in i around 0 89.7%
if -inf.0 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 1e269Initial program 99.0%
associate-*r*99.9%
*-commutative99.9%
+-commutative99.9%
distribute-lft-in99.9%
Applied egg-rr99.9%
if 1e269 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) Initial program 79.2%
Taylor expanded in x around 0 85.8%
associate-*r*91.7%
+-commutative91.7%
fma-udef91.7%
Simplified91.7%
Final simplification96.5%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ a (* b c))) (t_2 (* c (* t_1 i))) (t_3 (* (* c t_1) i)))
(if (<= t_3 (- INFINITY))
(* -2.0 t_2)
(if (<= t_3 8e+292)
(* 2.0 (- (+ (* x y) (* z t)) (+ (* (* b c) (* c i)) (* a (* c i)))))
(* 2.0 (- (* z t) t_2))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = a + (b * c);
double t_2 = c * (t_1 * i);
double t_3 = (c * t_1) * i;
double tmp;
if (t_3 <= -((double) INFINITY)) {
tmp = -2.0 * t_2;
} else if (t_3 <= 8e+292) {
tmp = 2.0 * (((x * y) + (z * t)) - (((b * c) * (c * i)) + (a * (c * i))));
} else {
tmp = 2.0 * ((z * t) - t_2);
}
return tmp;
}
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = a + (b * c);
double t_2 = c * (t_1 * i);
double t_3 = (c * t_1) * i;
double tmp;
if (t_3 <= -Double.POSITIVE_INFINITY) {
tmp = -2.0 * t_2;
} else if (t_3 <= 8e+292) {
tmp = 2.0 * (((x * y) + (z * t)) - (((b * c) * (c * i)) + (a * (c * i))));
} else {
tmp = 2.0 * ((z * t) - t_2);
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = a + (b * c) t_2 = c * (t_1 * i) t_3 = (c * t_1) * i tmp = 0 if t_3 <= -math.inf: tmp = -2.0 * t_2 elif t_3 <= 8e+292: tmp = 2.0 * (((x * y) + (z * t)) - (((b * c) * (c * i)) + (a * (c * i)))) else: tmp = 2.0 * ((z * t) - t_2) return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(a + Float64(b * c)) t_2 = Float64(c * Float64(t_1 * i)) t_3 = Float64(Float64(c * t_1) * i) tmp = 0.0 if (t_3 <= Float64(-Inf)) tmp = Float64(-2.0 * t_2); elseif (t_3 <= 8e+292) tmp = Float64(2.0 * Float64(Float64(Float64(x * y) + Float64(z * t)) - Float64(Float64(Float64(b * c) * Float64(c * i)) + Float64(a * Float64(c * i))))); else tmp = Float64(2.0 * Float64(Float64(z * t) - t_2)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = a + (b * c); t_2 = c * (t_1 * i); t_3 = (c * t_1) * i; tmp = 0.0; if (t_3 <= -Inf) tmp = -2.0 * t_2; elseif (t_3 <= 8e+292) tmp = 2.0 * (((x * y) + (z * t)) - (((b * c) * (c * i)) + (a * (c * i)))); else tmp = 2.0 * ((z * t) - t_2); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(c * N[(t$95$1 * i), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(c * t$95$1), $MachinePrecision] * i), $MachinePrecision]}, If[LessEqual[t$95$3, (-Infinity)], N[(-2.0 * t$95$2), $MachinePrecision], If[LessEqual[t$95$3, 8e+292], N[(2.0 * N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] - N[(N[(N[(b * c), $MachinePrecision] * N[(c * i), $MachinePrecision]), $MachinePrecision] + N[(a * N[(c * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[(z * t), $MachinePrecision] - t$95$2), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a + b \cdot c\\
t_2 := c \cdot \left(t_1 \cdot i\right)\\
t_3 := \left(c \cdot t_1\right) \cdot i\\
\mathbf{if}\;t_3 \leq -\infty:\\
\;\;\;\;-2 \cdot t_2\\
\mathbf{elif}\;t_3 \leq 8 \cdot 10^{+292}:\\
\;\;\;\;2 \cdot \left(\left(x \cdot y + z \cdot t\right) - \left(\left(b \cdot c\right) \cdot \left(c \cdot i\right) + a \cdot \left(c \cdot i\right)\right)\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 72.9%
Taylor expanded in i around inf 89.7%
Taylor expanded in i around 0 89.7%
if -inf.0 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 8.0000000000000001e292Initial program 99.0%
associate-*r*99.9%
*-commutative99.9%
+-commutative99.9%
distribute-lft-in99.9%
Applied egg-rr99.9%
if 8.0000000000000001e292 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) Initial program 77.8%
Taylor expanded in x around 0 91.1%
Final simplification96.5%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* -2.0 (* c (* (+ a (* b c)) i))))
(t_2 (* 2.0 (- (* z t) (* i (* a c)))))
(t_3 (* 2.0 (- (* x y) (* c (* b (* c i)))))))
(if (<= (* x y) -2e+90)
t_3
(if (<= (* x y) -5e+20)
t_2
(if (<= (* x y) -5e-45)
t_3
(if (<= (* x y) -1e-112)
t_1
(if (<= (* x y) 5e-281)
t_2
(if (<= (* x y) 5e-88)
t_1
(if (<= (* x y) 5000000000.0) t_2 t_3)))))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = -2.0 * (c * ((a + (b * c)) * i));
double t_2 = 2.0 * ((z * t) - (i * (a * c)));
double t_3 = 2.0 * ((x * y) - (c * (b * (c * i))));
double tmp;
if ((x * y) <= -2e+90) {
tmp = t_3;
} else if ((x * y) <= -5e+20) {
tmp = t_2;
} else if ((x * y) <= -5e-45) {
tmp = t_3;
} else if ((x * y) <= -1e-112) {
tmp = t_1;
} else if ((x * y) <= 5e-281) {
tmp = t_2;
} else if ((x * y) <= 5e-88) {
tmp = t_1;
} else if ((x * y) <= 5000000000.0) {
tmp = t_2;
} else {
tmp = t_3;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: tmp
t_1 = (-2.0d0) * (c * ((a + (b * c)) * i))
t_2 = 2.0d0 * ((z * t) - (i * (a * c)))
t_3 = 2.0d0 * ((x * y) - (c * (b * (c * i))))
if ((x * y) <= (-2d+90)) then
tmp = t_3
else if ((x * y) <= (-5d+20)) then
tmp = t_2
else if ((x * y) <= (-5d-45)) then
tmp = t_3
else if ((x * y) <= (-1d-112)) then
tmp = t_1
else if ((x * y) <= 5d-281) then
tmp = t_2
else if ((x * y) <= 5d-88) then
tmp = t_1
else if ((x * y) <= 5000000000.0d0) then
tmp = t_2
else
tmp = t_3
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = -2.0 * (c * ((a + (b * c)) * i));
double t_2 = 2.0 * ((z * t) - (i * (a * c)));
double t_3 = 2.0 * ((x * y) - (c * (b * (c * i))));
double tmp;
if ((x * y) <= -2e+90) {
tmp = t_3;
} else if ((x * y) <= -5e+20) {
tmp = t_2;
} else if ((x * y) <= -5e-45) {
tmp = t_3;
} else if ((x * y) <= -1e-112) {
tmp = t_1;
} else if ((x * y) <= 5e-281) {
tmp = t_2;
} else if ((x * y) <= 5e-88) {
tmp = t_1;
} else if ((x * y) <= 5000000000.0) {
tmp = t_2;
} else {
tmp = t_3;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = -2.0 * (c * ((a + (b * c)) * i)) t_2 = 2.0 * ((z * t) - (i * (a * c))) t_3 = 2.0 * ((x * y) - (c * (b * (c * i)))) tmp = 0 if (x * y) <= -2e+90: tmp = t_3 elif (x * y) <= -5e+20: tmp = t_2 elif (x * y) <= -5e-45: tmp = t_3 elif (x * y) <= -1e-112: tmp = t_1 elif (x * y) <= 5e-281: tmp = t_2 elif (x * y) <= 5e-88: tmp = t_1 elif (x * y) <= 5000000000.0: tmp = t_2 else: tmp = t_3 return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(-2.0 * Float64(c * Float64(Float64(a + Float64(b * c)) * i))) t_2 = Float64(2.0 * Float64(Float64(z * t) - Float64(i * Float64(a * c)))) t_3 = Float64(2.0 * Float64(Float64(x * y) - Float64(c * Float64(b * Float64(c * i))))) tmp = 0.0 if (Float64(x * y) <= -2e+90) tmp = t_3; elseif (Float64(x * y) <= -5e+20) tmp = t_2; elseif (Float64(x * y) <= -5e-45) tmp = t_3; elseif (Float64(x * y) <= -1e-112) tmp = t_1; elseif (Float64(x * y) <= 5e-281) tmp = t_2; elseif (Float64(x * y) <= 5e-88) tmp = t_1; elseif (Float64(x * y) <= 5000000000.0) tmp = t_2; else tmp = t_3; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = -2.0 * (c * ((a + (b * c)) * i)); t_2 = 2.0 * ((z * t) - (i * (a * c))); t_3 = 2.0 * ((x * y) - (c * (b * (c * i)))); tmp = 0.0; if ((x * y) <= -2e+90) tmp = t_3; elseif ((x * y) <= -5e+20) tmp = t_2; elseif ((x * y) <= -5e-45) tmp = t_3; elseif ((x * y) <= -1e-112) tmp = t_1; elseif ((x * y) <= 5e-281) tmp = t_2; elseif ((x * y) <= 5e-88) tmp = t_1; elseif ((x * y) <= 5000000000.0) tmp = t_2; else tmp = t_3; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(-2.0 * N[(c * N[(N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(2.0 * N[(N[(z * t), $MachinePrecision] - N[(i * N[(a * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(2.0 * N[(N[(x * y), $MachinePrecision] - N[(c * N[(b * N[(c * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x * y), $MachinePrecision], -2e+90], t$95$3, If[LessEqual[N[(x * y), $MachinePrecision], -5e+20], t$95$2, If[LessEqual[N[(x * y), $MachinePrecision], -5e-45], t$95$3, If[LessEqual[N[(x * y), $MachinePrecision], -1e-112], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], 5e-281], t$95$2, If[LessEqual[N[(x * y), $MachinePrecision], 5e-88], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], 5000000000.0], t$95$2, t$95$3]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := -2 \cdot \left(c \cdot \left(\left(a + b \cdot c\right) \cdot i\right)\right)\\
t_2 := 2 \cdot \left(z \cdot t - i \cdot \left(a \cdot c\right)\right)\\
t_3 := 2 \cdot \left(x \cdot y - c \cdot \left(b \cdot \left(c \cdot i\right)\right)\right)\\
\mathbf{if}\;x \cdot y \leq -2 \cdot 10^{+90}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;x \cdot y \leq -5 \cdot 10^{+20}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;x \cdot y \leq -5 \cdot 10^{-45}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;x \cdot y \leq -1 \cdot 10^{-112}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \cdot y \leq 5 \cdot 10^{-281}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;x \cdot y \leq 5 \cdot 10^{-88}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \cdot y \leq 5000000000:\\
\;\;\;\;t_2\\
\mathbf{else}:\\
\;\;\;\;t_3\\
\end{array}
\end{array}
if (*.f64 x y) < -1.99999999999999993e90 or -5e20 < (*.f64 x y) < -4.99999999999999976e-45 or 5e9 < (*.f64 x y) Initial program 87.6%
Taylor expanded in z around 0 77.7%
Taylor expanded in a around 0 73.0%
if -1.99999999999999993e90 < (*.f64 x y) < -5e20 or -9.9999999999999995e-113 < (*.f64 x y) < 4.9999999999999998e-281 or 5.00000000000000009e-88 < (*.f64 x y) < 5e9Initial program 96.2%
Taylor expanded in a around inf 77.4%
*-commutative77.4%
Simplified77.4%
Taylor expanded in x around 0 74.0%
associate-*r*75.1%
*-commutative75.1%
Simplified75.1%
if -4.99999999999999976e-45 < (*.f64 x y) < -9.9999999999999995e-113 or 4.9999999999999998e-281 < (*.f64 x y) < 5.00000000000000009e-88Initial program 86.9%
Taylor expanded in i around inf 81.1%
Taylor expanded in i around 0 81.1%
Final simplification74.9%
(FPCore (x y z t a b c i) :precision binary64 (let* ((t_1 (+ a (* b c))) (t_2 (- (+ (* x y) (* z t)) (* (* c t_1) i)))) (if (<= t_2 INFINITY) (* t_2 2.0) (* -2.0 (* c (* t_1 i))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = a + (b * c);
double t_2 = ((x * y) + (z * t)) - ((c * t_1) * i);
double tmp;
if (t_2 <= ((double) INFINITY)) {
tmp = t_2 * 2.0;
} else {
tmp = -2.0 * (c * (t_1 * i));
}
return tmp;
}
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = a + (b * c);
double t_2 = ((x * y) + (z * t)) - ((c * t_1) * i);
double tmp;
if (t_2 <= Double.POSITIVE_INFINITY) {
tmp = t_2 * 2.0;
} else {
tmp = -2.0 * (c * (t_1 * i));
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = a + (b * c) t_2 = ((x * y) + (z * t)) - ((c * t_1) * i) tmp = 0 if t_2 <= math.inf: tmp = t_2 * 2.0 else: tmp = -2.0 * (c * (t_1 * i)) return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(a + Float64(b * c)) t_2 = Float64(Float64(Float64(x * y) + Float64(z * t)) - Float64(Float64(c * t_1) * i)) tmp = 0.0 if (t_2 <= Inf) tmp = Float64(t_2 * 2.0); else tmp = Float64(-2.0 * Float64(c * Float64(t_1 * i))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = a + (b * c); t_2 = ((x * y) + (z * t)) - ((c * t_1) * i); tmp = 0.0; if (t_2 <= Inf) tmp = t_2 * 2.0; else tmp = -2.0 * (c * (t_1 * i)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] - N[(N[(c * t$95$1), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, Infinity], N[(t$95$2 * 2.0), $MachinePrecision], N[(-2.0 * N[(c * N[(t$95$1 * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a + b \cdot c\\
t_2 := \left(x \cdot y + z \cdot t\right) - \left(c \cdot t_1\right) \cdot i\\
\mathbf{if}\;t_2 \leq \infty:\\
\;\;\;\;t_2 \cdot 2\\
\mathbf{else}:\\
\;\;\;\;-2 \cdot \left(c \cdot \left(t_1 \cdot i\right)\right)\\
\end{array}
\end{array}
if (-.f64 (+.f64 (*.f64 x y) (*.f64 z t)) (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i)) < +inf.0Initial program 95.9%
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 i around inf 71.5%
Taylor expanded in i around 0 71.5%
Final simplification94.5%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* i (* c (* a -2.0))))
(t_2 (* 2.0 (* z t)))
(t_3 (* (* x y) 2.0)))
(if (<= (* x y) -2e+90)
t_3
(if (<= (* x y) -2e-134)
t_1
(if (<= (* x y) 2e-281)
t_2
(if (<= (* x y) 5e-99)
t_1
(if (<= (* x y) 5000000000.0) t_2 t_3)))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = i * (c * (a * -2.0));
double t_2 = 2.0 * (z * t);
double t_3 = (x * y) * 2.0;
double tmp;
if ((x * y) <= -2e+90) {
tmp = t_3;
} else if ((x * y) <= -2e-134) {
tmp = t_1;
} else if ((x * y) <= 2e-281) {
tmp = t_2;
} else if ((x * y) <= 5e-99) {
tmp = t_1;
} else if ((x * y) <= 5000000000.0) {
tmp = t_2;
} else {
tmp = t_3;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: tmp
t_1 = i * (c * (a * (-2.0d0)))
t_2 = 2.0d0 * (z * t)
t_3 = (x * y) * 2.0d0
if ((x * y) <= (-2d+90)) then
tmp = t_3
else if ((x * y) <= (-2d-134)) then
tmp = t_1
else if ((x * y) <= 2d-281) then
tmp = t_2
else if ((x * y) <= 5d-99) then
tmp = t_1
else if ((x * y) <= 5000000000.0d0) then
tmp = t_2
else
tmp = t_3
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = i * (c * (a * -2.0));
double t_2 = 2.0 * (z * t);
double t_3 = (x * y) * 2.0;
double tmp;
if ((x * y) <= -2e+90) {
tmp = t_3;
} else if ((x * y) <= -2e-134) {
tmp = t_1;
} else if ((x * y) <= 2e-281) {
tmp = t_2;
} else if ((x * y) <= 5e-99) {
tmp = t_1;
} else if ((x * y) <= 5000000000.0) {
tmp = t_2;
} else {
tmp = t_3;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = i * (c * (a * -2.0)) t_2 = 2.0 * (z * t) t_3 = (x * y) * 2.0 tmp = 0 if (x * y) <= -2e+90: tmp = t_3 elif (x * y) <= -2e-134: tmp = t_1 elif (x * y) <= 2e-281: tmp = t_2 elif (x * y) <= 5e-99: tmp = t_1 elif (x * y) <= 5000000000.0: tmp = t_2 else: tmp = t_3 return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(i * Float64(c * Float64(a * -2.0))) t_2 = Float64(2.0 * Float64(z * t)) t_3 = Float64(Float64(x * y) * 2.0) tmp = 0.0 if (Float64(x * y) <= -2e+90) tmp = t_3; elseif (Float64(x * y) <= -2e-134) tmp = t_1; elseif (Float64(x * y) <= 2e-281) tmp = t_2; elseif (Float64(x * y) <= 5e-99) tmp = t_1; elseif (Float64(x * y) <= 5000000000.0) tmp = t_2; else tmp = t_3; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = i * (c * (a * -2.0)); t_2 = 2.0 * (z * t); t_3 = (x * y) * 2.0; tmp = 0.0; if ((x * y) <= -2e+90) tmp = t_3; elseif ((x * y) <= -2e-134) tmp = t_1; elseif ((x * y) <= 2e-281) tmp = t_2; elseif ((x * y) <= 5e-99) tmp = t_1; elseif ((x * y) <= 5000000000.0) tmp = t_2; else tmp = t_3; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(i * N[(c * N[(a * -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(2.0 * N[(z * t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(x * y), $MachinePrecision] * 2.0), $MachinePrecision]}, If[LessEqual[N[(x * y), $MachinePrecision], -2e+90], t$95$3, If[LessEqual[N[(x * y), $MachinePrecision], -2e-134], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], 2e-281], t$95$2, If[LessEqual[N[(x * y), $MachinePrecision], 5e-99], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], 5000000000.0], t$95$2, t$95$3]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := i \cdot \left(c \cdot \left(a \cdot -2\right)\right)\\
t_2 := 2 \cdot \left(z \cdot t\right)\\
t_3 := \left(x \cdot y\right) \cdot 2\\
\mathbf{if}\;x \cdot y \leq -2 \cdot 10^{+90}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;x \cdot y \leq -2 \cdot 10^{-134}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \cdot y \leq 2 \cdot 10^{-281}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;x \cdot y \leq 5 \cdot 10^{-99}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \cdot y \leq 5000000000:\\
\;\;\;\;t_2\\
\mathbf{else}:\\
\;\;\;\;t_3\\
\end{array}
\end{array}
if (*.f64 x y) < -1.99999999999999993e90 or 5e9 < (*.f64 x y) Initial program 87.6%
Taylor expanded in x around inf 57.1%
if -1.99999999999999993e90 < (*.f64 x y) < -2.00000000000000008e-134 or 2e-281 < (*.f64 x y) < 4.99999999999999969e-99Initial program 90.3%
Taylor expanded in a around inf 46.7%
mul-1-neg46.7%
*-commutative46.7%
distribute-rgt-neg-in46.7%
Simplified46.7%
Taylor expanded in c around 0 46.7%
associate-*r*46.7%
Simplified46.7%
Taylor expanded in a around 0 46.7%
associate-*l*46.7%
*-commutative46.7%
associate-*r*40.0%
*-commutative40.0%
associate-*l*40.1%
Simplified40.1%
if -2.00000000000000008e-134 < (*.f64 x y) < 2e-281 or 4.99999999999999969e-99 < (*.f64 x y) < 5e9Initial program 95.4%
Taylor expanded in z around inf 47.4%
Final simplification49.7%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* (* c i) (* a -2.0)))
(t_2 (* 2.0 (* z t)))
(t_3 (* (* x y) 2.0)))
(if (<= (* x y) -2e+90)
t_3
(if (<= (* x y) -2e-134)
t_1
(if (<= (* x y) 2e-281)
t_2
(if (<= (* x y) 5e-88)
t_1
(if (<= (* x y) 5000000000.0) t_2 t_3)))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = (c * i) * (a * -2.0);
double t_2 = 2.0 * (z * t);
double t_3 = (x * y) * 2.0;
double tmp;
if ((x * y) <= -2e+90) {
tmp = t_3;
} else if ((x * y) <= -2e-134) {
tmp = t_1;
} else if ((x * y) <= 2e-281) {
tmp = t_2;
} else if ((x * y) <= 5e-88) {
tmp = t_1;
} else if ((x * y) <= 5000000000.0) {
tmp = t_2;
} else {
tmp = t_3;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: tmp
t_1 = (c * i) * (a * (-2.0d0))
t_2 = 2.0d0 * (z * t)
t_3 = (x * y) * 2.0d0
if ((x * y) <= (-2d+90)) then
tmp = t_3
else if ((x * y) <= (-2d-134)) then
tmp = t_1
else if ((x * y) <= 2d-281) then
tmp = t_2
else if ((x * y) <= 5d-88) then
tmp = t_1
else if ((x * y) <= 5000000000.0d0) then
tmp = t_2
else
tmp = t_3
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = (c * i) * (a * -2.0);
double t_2 = 2.0 * (z * t);
double t_3 = (x * y) * 2.0;
double tmp;
if ((x * y) <= -2e+90) {
tmp = t_3;
} else if ((x * y) <= -2e-134) {
tmp = t_1;
} else if ((x * y) <= 2e-281) {
tmp = t_2;
} else if ((x * y) <= 5e-88) {
tmp = t_1;
} else if ((x * y) <= 5000000000.0) {
tmp = t_2;
} else {
tmp = t_3;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = (c * i) * (a * -2.0) t_2 = 2.0 * (z * t) t_3 = (x * y) * 2.0 tmp = 0 if (x * y) <= -2e+90: tmp = t_3 elif (x * y) <= -2e-134: tmp = t_1 elif (x * y) <= 2e-281: tmp = t_2 elif (x * y) <= 5e-88: tmp = t_1 elif (x * y) <= 5000000000.0: tmp = t_2 else: tmp = t_3 return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(Float64(c * i) * Float64(a * -2.0)) t_2 = Float64(2.0 * Float64(z * t)) t_3 = Float64(Float64(x * y) * 2.0) tmp = 0.0 if (Float64(x * y) <= -2e+90) tmp = t_3; elseif (Float64(x * y) <= -2e-134) tmp = t_1; elseif (Float64(x * y) <= 2e-281) tmp = t_2; elseif (Float64(x * y) <= 5e-88) tmp = t_1; elseif (Float64(x * y) <= 5000000000.0) tmp = t_2; else tmp = t_3; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = (c * i) * (a * -2.0); t_2 = 2.0 * (z * t); t_3 = (x * y) * 2.0; tmp = 0.0; if ((x * y) <= -2e+90) tmp = t_3; elseif ((x * y) <= -2e-134) tmp = t_1; elseif ((x * y) <= 2e-281) tmp = t_2; elseif ((x * y) <= 5e-88) tmp = t_1; elseif ((x * y) <= 5000000000.0) tmp = t_2; else tmp = t_3; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(c * i), $MachinePrecision] * N[(a * -2.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(2.0 * N[(z * t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(x * y), $MachinePrecision] * 2.0), $MachinePrecision]}, If[LessEqual[N[(x * y), $MachinePrecision], -2e+90], t$95$3, If[LessEqual[N[(x * y), $MachinePrecision], -2e-134], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], 2e-281], t$95$2, If[LessEqual[N[(x * y), $MachinePrecision], 5e-88], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], 5000000000.0], t$95$2, t$95$3]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(c \cdot i\right) \cdot \left(a \cdot -2\right)\\
t_2 := 2 \cdot \left(z \cdot t\right)\\
t_3 := \left(x \cdot y\right) \cdot 2\\
\mathbf{if}\;x \cdot y \leq -2 \cdot 10^{+90}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;x \cdot y \leq -2 \cdot 10^{-134}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \cdot y \leq 2 \cdot 10^{-281}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;x \cdot y \leq 5 \cdot 10^{-88}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \cdot y \leq 5000000000:\\
\;\;\;\;t_2\\
\mathbf{else}:\\
\;\;\;\;t_3\\
\end{array}
\end{array}
if (*.f64 x y) < -1.99999999999999993e90 or 5e9 < (*.f64 x y) Initial program 87.6%
Taylor expanded in x around inf 57.1%
if -1.99999999999999993e90 < (*.f64 x y) < -2.00000000000000008e-134 or 2e-281 < (*.f64 x y) < 5.00000000000000009e-88Initial program 90.5%
Taylor expanded in a around inf 46.8%
mul-1-neg46.8%
*-commutative46.8%
distribute-rgt-neg-in46.8%
Simplified46.8%
Taylor expanded in c around 0 46.8%
associate-*r*46.8%
Simplified46.8%
if -2.00000000000000008e-134 < (*.f64 x y) < 2e-281 or 5.00000000000000009e-88 < (*.f64 x y) < 5e9Initial program 95.3%
Taylor expanded in z around inf 48.5%
Final simplification51.8%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* 2.0 (* z t)))
(t_2 (* (* x y) 2.0))
(t_3 (* -2.0 (* c (* (+ a (* b c)) i)))))
(if (<= c -4e-104)
t_3
(if (<= c 1.02e-245)
t_2
(if (<= c 8e-204)
t_1
(if (<= c 2.7e-119)
t_2
(if (<= c 5.8e-94) t_1 (if (<= c 4.5e-60) t_2 t_3))))))))
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 = (x * y) * 2.0;
double t_3 = -2.0 * (c * ((a + (b * c)) * i));
double tmp;
if (c <= -4e-104) {
tmp = t_3;
} else if (c <= 1.02e-245) {
tmp = t_2;
} else if (c <= 8e-204) {
tmp = t_1;
} else if (c <= 2.7e-119) {
tmp = t_2;
} else if (c <= 5.8e-94) {
tmp = t_1;
} else if (c <= 4.5e-60) {
tmp = t_2;
} else {
tmp = t_3;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: tmp
t_1 = 2.0d0 * (z * t)
t_2 = (x * y) * 2.0d0
t_3 = (-2.0d0) * (c * ((a + (b * c)) * i))
if (c <= (-4d-104)) then
tmp = t_3
else if (c <= 1.02d-245) then
tmp = t_2
else if (c <= 8d-204) then
tmp = t_1
else if (c <= 2.7d-119) then
tmp = t_2
else if (c <= 5.8d-94) then
tmp = t_1
else if (c <= 4.5d-60) then
tmp = t_2
else
tmp = t_3
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = 2.0 * (z * t);
double t_2 = (x * y) * 2.0;
double t_3 = -2.0 * (c * ((a + (b * c)) * i));
double tmp;
if (c <= -4e-104) {
tmp = t_3;
} else if (c <= 1.02e-245) {
tmp = t_2;
} else if (c <= 8e-204) {
tmp = t_1;
} else if (c <= 2.7e-119) {
tmp = t_2;
} else if (c <= 5.8e-94) {
tmp = t_1;
} else if (c <= 4.5e-60) {
tmp = t_2;
} else {
tmp = t_3;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = 2.0 * (z * t) t_2 = (x * y) * 2.0 t_3 = -2.0 * (c * ((a + (b * c)) * i)) tmp = 0 if c <= -4e-104: tmp = t_3 elif c <= 1.02e-245: tmp = t_2 elif c <= 8e-204: tmp = t_1 elif c <= 2.7e-119: tmp = t_2 elif c <= 5.8e-94: tmp = t_1 elif c <= 4.5e-60: tmp = t_2 else: tmp = t_3 return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(2.0 * Float64(z * t)) t_2 = Float64(Float64(x * y) * 2.0) t_3 = Float64(-2.0 * Float64(c * Float64(Float64(a + Float64(b * c)) * i))) tmp = 0.0 if (c <= -4e-104) tmp = t_3; elseif (c <= 1.02e-245) tmp = t_2; elseif (c <= 8e-204) tmp = t_1; elseif (c <= 2.7e-119) tmp = t_2; elseif (c <= 5.8e-94) tmp = t_1; elseif (c <= 4.5e-60) tmp = t_2; else tmp = t_3; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = 2.0 * (z * t); t_2 = (x * y) * 2.0; t_3 = -2.0 * (c * ((a + (b * c)) * i)); tmp = 0.0; if (c <= -4e-104) tmp = t_3; elseif (c <= 1.02e-245) tmp = t_2; elseif (c <= 8e-204) tmp = t_1; elseif (c <= 2.7e-119) tmp = t_2; elseif (c <= 5.8e-94) tmp = t_1; elseif (c <= 4.5e-60) tmp = t_2; else tmp = t_3; 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[(N[(x * y), $MachinePrecision] * 2.0), $MachinePrecision]}, Block[{t$95$3 = N[(-2.0 * N[(c * N[(N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[c, -4e-104], t$95$3, If[LessEqual[c, 1.02e-245], t$95$2, If[LessEqual[c, 8e-204], t$95$1, If[LessEqual[c, 2.7e-119], t$95$2, If[LessEqual[c, 5.8e-94], t$95$1, If[LessEqual[c, 4.5e-60], t$95$2, t$95$3]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := 2 \cdot \left(z \cdot t\right)\\
t_2 := \left(x \cdot y\right) \cdot 2\\
t_3 := -2 \cdot \left(c \cdot \left(\left(a + b \cdot c\right) \cdot i\right)\right)\\
\mathbf{if}\;c \leq -4 \cdot 10^{-104}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;c \leq 1.02 \cdot 10^{-245}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;c \leq 8 \cdot 10^{-204}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;c \leq 2.7 \cdot 10^{-119}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;c \leq 5.8 \cdot 10^{-94}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;c \leq 4.5 \cdot 10^{-60}:\\
\;\;\;\;t_2\\
\mathbf{else}:\\
\;\;\;\;t_3\\
\end{array}
\end{array}
if c < -3.99999999999999971e-104 or 4.50000000000000001e-60 < c Initial program 85.7%
Taylor expanded in i around inf 70.7%
Taylor expanded in i around 0 70.7%
if -3.99999999999999971e-104 < c < 1.01999999999999994e-245 or 8.00000000000000001e-204 < c < 2.70000000000000027e-119 or 5.79999999999999991e-94 < c < 4.50000000000000001e-60Initial program 98.0%
Taylor expanded in x around inf 53.1%
if 1.01999999999999994e-245 < c < 8.00000000000000001e-204 or 2.70000000000000027e-119 < c < 5.79999999999999991e-94Initial program 99.9%
Taylor expanded in z around inf 65.2%
Final simplification65.1%
(FPCore (x y z t a b c i)
:precision binary64
(if (or (<= c -5.5e-78)
(and (not (<= c 6.2e-60)) (or (<= c 6.2e+75) (not (<= c 1.6e+145)))))
(* 2.0 (- (* z t) (* c (* (+ a (* b c)) i))))
(* 2.0 (- (+ (* x y) (* z t)) (* i (* a c))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((c <= -5.5e-78) || (!(c <= 6.2e-60) && ((c <= 6.2e+75) || !(c <= 1.6e+145)))) {
tmp = 2.0 * ((z * t) - (c * ((a + (b * c)) * i)));
} else {
tmp = 2.0 * (((x * y) + (z * t)) - (i * (a * c)));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: tmp
if ((c <= (-5.5d-78)) .or. (.not. (c <= 6.2d-60)) .and. (c <= 6.2d+75) .or. (.not. (c <= 1.6d+145))) then
tmp = 2.0d0 * ((z * t) - (c * ((a + (b * c)) * i)))
else
tmp = 2.0d0 * (((x * y) + (z * t)) - (i * (a * c)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((c <= -5.5e-78) || (!(c <= 6.2e-60) && ((c <= 6.2e+75) || !(c <= 1.6e+145)))) {
tmp = 2.0 * ((z * t) - (c * ((a + (b * c)) * i)));
} else {
tmp = 2.0 * (((x * y) + (z * t)) - (i * (a * c)));
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if (c <= -5.5e-78) or (not (c <= 6.2e-60) and ((c <= 6.2e+75) or not (c <= 1.6e+145))): tmp = 2.0 * ((z * t) - (c * ((a + (b * c)) * i))) else: tmp = 2.0 * (((x * y) + (z * t)) - (i * (a * c))) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if ((c <= -5.5e-78) || (!(c <= 6.2e-60) && ((c <= 6.2e+75) || !(c <= 1.6e+145)))) tmp = Float64(2.0 * Float64(Float64(z * t) - Float64(c * Float64(Float64(a + Float64(b * c)) * i)))); else tmp = Float64(2.0 * Float64(Float64(Float64(x * y) + Float64(z * t)) - Float64(i * Float64(a * c)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if ((c <= -5.5e-78) || (~((c <= 6.2e-60)) && ((c <= 6.2e+75) || ~((c <= 1.6e+145))))) tmp = 2.0 * ((z * t) - (c * ((a + (b * c)) * i))); else tmp = 2.0 * (((x * y) + (z * t)) - (i * (a * c))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[c, -5.5e-78], And[N[Not[LessEqual[c, 6.2e-60]], $MachinePrecision], Or[LessEqual[c, 6.2e+75], N[Not[LessEqual[c, 1.6e+145]], $MachinePrecision]]]], N[(2.0 * N[(N[(z * t), $MachinePrecision] - N[(c * N[(N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] - N[(i * N[(a * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;c \leq -5.5 \cdot 10^{-78} \lor \neg \left(c \leq 6.2 \cdot 10^{-60}\right) \land \left(c \leq 6.2 \cdot 10^{+75} \lor \neg \left(c \leq 1.6 \cdot 10^{+145}\right)\right):\\
\;\;\;\;2 \cdot \left(z \cdot t - c \cdot \left(\left(a + b \cdot c\right) \cdot i\right)\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(\left(x \cdot y + z \cdot t\right) - i \cdot \left(a \cdot c\right)\right)\\
\end{array}
\end{array}
if c < -5.50000000000000017e-78 or 6.19999999999999976e-60 < c < 6.2000000000000002e75 or 1.60000000000000004e145 < c Initial program 87.1%
Taylor expanded in x around 0 88.5%
if -5.50000000000000017e-78 < c < 6.19999999999999976e-60 or 6.2000000000000002e75 < c < 1.60000000000000004e145Initial program 94.6%
Taylor expanded in a around inf 90.8%
*-commutative90.8%
Simplified90.8%
Final simplification89.6%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= (* x y) -2e+90) (not (<= (* x y) 500000000.0))) (* 2.0 (- (* x y) (* c (* b (* c i))))) (* 2.0 (- (* z t) (* c (* (+ a (* b c)) i))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (((x * y) <= -2e+90) || !((x * y) <= 500000000.0)) {
tmp = 2.0 * ((x * y) - (c * (b * (c * i))));
} else {
tmp = 2.0 * ((z * t) - (c * ((a + (b * c)) * i)));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: tmp
if (((x * y) <= (-2d+90)) .or. (.not. ((x * y) <= 500000000.0d0))) then
tmp = 2.0d0 * ((x * y) - (c * (b * (c * i))))
else
tmp = 2.0d0 * ((z * t) - (c * ((a + (b * c)) * i)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (((x * y) <= -2e+90) || !((x * y) <= 500000000.0)) {
tmp = 2.0 * ((x * y) - (c * (b * (c * i))));
} else {
tmp = 2.0 * ((z * t) - (c * ((a + (b * c)) * i)));
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if ((x * y) <= -2e+90) or not ((x * y) <= 500000000.0): tmp = 2.0 * ((x * y) - (c * (b * (c * i)))) else: tmp = 2.0 * ((z * t) - (c * ((a + (b * c)) * i))) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if ((Float64(x * y) <= -2e+90) || !(Float64(x * y) <= 500000000.0)) tmp = Float64(2.0 * Float64(Float64(x * y) - Float64(c * Float64(b * Float64(c * i))))); else tmp = Float64(2.0 * Float64(Float64(z * t) - Float64(c * Float64(Float64(a + Float64(b * c)) * i)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if (((x * y) <= -2e+90) || ~(((x * y) <= 500000000.0))) tmp = 2.0 * ((x * y) - (c * (b * (c * i)))); else tmp = 2.0 * ((z * t) - (c * ((a + (b * c)) * i))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[N[(x * y), $MachinePrecision], -2e+90], N[Not[LessEqual[N[(x * y), $MachinePrecision], 500000000.0]], $MachinePrecision]], N[(2.0 * N[(N[(x * y), $MachinePrecision] - N[(c * N[(b * N[(c * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[(z * t), $MachinePrecision] - N[(c * N[(N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \cdot y \leq -2 \cdot 10^{+90} \lor \neg \left(x \cdot y \leq 500000000\right):\\
\;\;\;\;2 \cdot \left(x \cdot y - c \cdot \left(b \cdot \left(c \cdot i\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(z \cdot t - c \cdot \left(\left(a + b \cdot c\right) \cdot i\right)\right)\\
\end{array}
\end{array}
if (*.f64 x y) < -1.99999999999999993e90 or 5e8 < (*.f64 x y) Initial program 87.7%
Taylor expanded in z around 0 77.6%
Taylor expanded in a around 0 74.0%
if -1.99999999999999993e90 < (*.f64 x y) < 5e8Initial program 92.9%
Taylor expanded in x around 0 87.9%
Final simplification81.8%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* c (* (+ a (* b c)) i))))
(if (or (<= (* x y) -2e+90) (not (<= (* x y) 500000000.0)))
(* 2.0 (- (* x y) t_1))
(* 2.0 (- (* z t) t_1)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = c * ((a + (b * c)) * i);
double tmp;
if (((x * y) <= -2e+90) || !((x * y) <= 500000000.0)) {
tmp = 2.0 * ((x * y) - t_1);
} else {
tmp = 2.0 * ((z * t) - t_1);
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: t_1
real(8) :: tmp
t_1 = c * ((a + (b * c)) * i)
if (((x * y) <= (-2d+90)) .or. (.not. ((x * y) <= 500000000.0d0))) then
tmp = 2.0d0 * ((x * y) - t_1)
else
tmp = 2.0d0 * ((z * t) - t_1)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = c * ((a + (b * c)) * i);
double tmp;
if (((x * y) <= -2e+90) || !((x * y) <= 500000000.0)) {
tmp = 2.0 * ((x * y) - t_1);
} else {
tmp = 2.0 * ((z * t) - t_1);
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = c * ((a + (b * c)) * i) tmp = 0 if ((x * y) <= -2e+90) or not ((x * y) <= 500000000.0): 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 ((Float64(x * y) <= -2e+90) || !(Float64(x * y) <= 500000000.0)) tmp = Float64(2.0 * Float64(Float64(x * y) - t_1)); else tmp = Float64(2.0 * Float64(Float64(z * t) - t_1)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = c * ((a + (b * c)) * i); tmp = 0.0; if (((x * y) <= -2e+90) || ~(((x * y) <= 500000000.0))) 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[N[(x * y), $MachinePrecision], -2e+90], N[Not[LessEqual[N[(x * y), $MachinePrecision], 500000000.0]], $MachinePrecision]], N[(2.0 * N[(N[(x * y), $MachinePrecision] - t$95$1), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[(z * t), $MachinePrecision] - t$95$1), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := c \cdot \left(\left(a + b \cdot c\right) \cdot i\right)\\
\mathbf{if}\;x \cdot y \leq -2 \cdot 10^{+90} \lor \neg \left(x \cdot y \leq 500000000\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) < -1.99999999999999993e90 or 5e8 < (*.f64 x y) Initial program 87.7%
Taylor expanded in z around 0 77.6%
if -1.99999999999999993e90 < (*.f64 x y) < 5e8Initial program 92.9%
Taylor expanded in x around 0 87.9%
Final simplification83.4%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* 2.0 (- (* z t) (* i (* a c)))))
(t_2 (* -2.0 (* c (* (+ a (* b c)) i)))))
(if (<= c -650000000000.0)
t_2
(if (<= c -2.06e-193)
t_1
(if (<= c 1.85e-245) (* (* x y) 2.0) (if (<= c 1.25e-64) 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) - (i * (a * c)));
double t_2 = -2.0 * (c * ((a + (b * c)) * i));
double tmp;
if (c <= -650000000000.0) {
tmp = t_2;
} else if (c <= -2.06e-193) {
tmp = t_1;
} else if (c <= 1.85e-245) {
tmp = (x * y) * 2.0;
} else if (c <= 1.25e-64) {
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) - (i * (a * c)))
t_2 = (-2.0d0) * (c * ((a + (b * c)) * i))
if (c <= (-650000000000.0d0)) then
tmp = t_2
else if (c <= (-2.06d-193)) then
tmp = t_1
else if (c <= 1.85d-245) then
tmp = (x * y) * 2.0d0
else if (c <= 1.25d-64) 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) - (i * (a * c)));
double t_2 = -2.0 * (c * ((a + (b * c)) * i));
double tmp;
if (c <= -650000000000.0) {
tmp = t_2;
} else if (c <= -2.06e-193) {
tmp = t_1;
} else if (c <= 1.85e-245) {
tmp = (x * y) * 2.0;
} else if (c <= 1.25e-64) {
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) - (i * (a * c))) t_2 = -2.0 * (c * ((a + (b * c)) * i)) tmp = 0 if c <= -650000000000.0: tmp = t_2 elif c <= -2.06e-193: tmp = t_1 elif c <= 1.85e-245: tmp = (x * y) * 2.0 elif c <= 1.25e-64: 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(z * t) - Float64(i * Float64(a * c)))) t_2 = Float64(-2.0 * Float64(c * Float64(Float64(a + Float64(b * c)) * i))) tmp = 0.0 if (c <= -650000000000.0) tmp = t_2; elseif (c <= -2.06e-193) tmp = t_1; elseif (c <= 1.85e-245) tmp = Float64(Float64(x * y) * 2.0); elseif (c <= 1.25e-64) 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) - (i * (a * c))); t_2 = -2.0 * (c * ((a + (b * c)) * i)); tmp = 0.0; if (c <= -650000000000.0) tmp = t_2; elseif (c <= -2.06e-193) tmp = t_1; elseif (c <= 1.85e-245) tmp = (x * y) * 2.0; elseif (c <= 1.25e-64) 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[(z * t), $MachinePrecision] - N[(i * N[(a * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(-2.0 * N[(c * N[(N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[c, -650000000000.0], t$95$2, If[LessEqual[c, -2.06e-193], t$95$1, If[LessEqual[c, 1.85e-245], N[(N[(x * y), $MachinePrecision] * 2.0), $MachinePrecision], If[LessEqual[c, 1.25e-64], t$95$1, t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := 2 \cdot \left(z \cdot t - i \cdot \left(a \cdot c\right)\right)\\
t_2 := -2 \cdot \left(c \cdot \left(\left(a + b \cdot c\right) \cdot i\right)\right)\\
\mathbf{if}\;c \leq -650000000000:\\
\;\;\;\;t_2\\
\mathbf{elif}\;c \leq -2.06 \cdot 10^{-193}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;c \leq 1.85 \cdot 10^{-245}:\\
\;\;\;\;\left(x \cdot y\right) \cdot 2\\
\mathbf{elif}\;c \leq 1.25 \cdot 10^{-64}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if c < -6.5e11 or 1.25000000000000008e-64 < c Initial program 83.7%
Taylor expanded in i around inf 72.5%
Taylor expanded in i around 0 72.5%
if -6.5e11 < c < -2.0600000000000001e-193 or 1.8500000000000001e-245 < c < 1.25000000000000008e-64Initial program 98.2%
Taylor expanded in a around inf 86.3%
*-commutative86.3%
Simplified86.3%
Taylor expanded in x around 0 58.1%
associate-*r*58.1%
*-commutative58.1%
Simplified58.1%
if -2.0600000000000001e-193 < c < 1.8500000000000001e-245Initial program 100.0%
Taylor expanded in x around inf 65.4%
Final simplification66.8%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= (* x y) -2e+90) (not (<= (* x y) 5000000000.0))) (* (* x y) 2.0) (* 2.0 (* z t))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (((x * y) <= -2e+90) || !((x * y) <= 5000000000.0)) {
tmp = (x * y) * 2.0;
} else {
tmp = 2.0 * (z * t);
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: tmp
if (((x * y) <= (-2d+90)) .or. (.not. ((x * y) <= 5000000000.0d0))) then
tmp = (x * y) * 2.0d0
else
tmp = 2.0d0 * (z * t)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (((x * y) <= -2e+90) || !((x * y) <= 5000000000.0)) {
tmp = (x * y) * 2.0;
} else {
tmp = 2.0 * (z * t);
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if ((x * y) <= -2e+90) or not ((x * y) <= 5000000000.0): tmp = (x * y) * 2.0 else: tmp = 2.0 * (z * t) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if ((Float64(x * y) <= -2e+90) || !(Float64(x * y) <= 5000000000.0)) tmp = Float64(Float64(x * y) * 2.0); else tmp = Float64(2.0 * Float64(z * t)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if (((x * y) <= -2e+90) || ~(((x * y) <= 5000000000.0))) tmp = (x * y) * 2.0; else tmp = 2.0 * (z * t); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[N[(x * y), $MachinePrecision], -2e+90], N[Not[LessEqual[N[(x * y), $MachinePrecision], 5000000000.0]], $MachinePrecision]], N[(N[(x * y), $MachinePrecision] * 2.0), $MachinePrecision], N[(2.0 * N[(z * t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \cdot y \leq -2 \cdot 10^{+90} \lor \neg \left(x \cdot y \leq 5000000000\right):\\
\;\;\;\;\left(x \cdot y\right) \cdot 2\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(z \cdot t\right)\\
\end{array}
\end{array}
if (*.f64 x y) < -1.99999999999999993e90 or 5e9 < (*.f64 x y) Initial program 87.6%
Taylor expanded in x around inf 57.1%
if -1.99999999999999993e90 < (*.f64 x y) < 5e9Initial program 93.0%
Taylor expanded in z around inf 36.8%
Final simplification45.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 90.6%
Taylor expanded in z around inf 27.8%
Final simplification27.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}
herbie shell --seed 2023320
(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))))