
(FPCore (x y z t a b c i) :precision binary64 (* 2.0 (- (+ (* x y) (* z t)) (* (* (+ a (* b c)) c) i))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return 2.0 * (((x * y) + (z * t)) - (((a + (b * c)) * c) * i));
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
code = 2.0d0 * (((x * y) + (z * t)) - (((a + (b * c)) * c) * i))
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return 2.0 * (((x * y) + (z * t)) - (((a + (b * c)) * c) * i));
}
def code(x, y, z, t, a, b, c, i): return 2.0 * (((x * y) + (z * t)) - (((a + (b * c)) * c) * i))
function code(x, y, z, t, a, b, c, i) return Float64(2.0 * Float64(Float64(Float64(x * y) + Float64(z * t)) - Float64(Float64(Float64(a + Float64(b * c)) * c) * i))) end
function tmp = code(x, y, z, t, a, b, c, i) tmp = 2.0 * (((x * y) + (z * t)) - (((a + (b * c)) * c) * i)); end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(2.0 * N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] - N[(N[(N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision] * c), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
2 \cdot \left(\left(x \cdot y + z \cdot t\right) - \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i\right)
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 16 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a b c i) :precision binary64 (* 2.0 (- (+ (* x y) (* z t)) (* (* (+ a (* b c)) c) i))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return 2.0 * (((x * y) + (z * t)) - (((a + (b * c)) * c) * i));
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
code = 2.0d0 * (((x * y) + (z * t)) - (((a + (b * c)) * c) * i))
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return 2.0 * (((x * y) + (z * t)) - (((a + (b * c)) * c) * i));
}
def code(x, y, z, t, a, b, c, i): return 2.0 * (((x * y) + (z * t)) - (((a + (b * c)) * c) * i))
function code(x, y, z, t, a, b, c, i) return Float64(2.0 * Float64(Float64(Float64(x * y) + Float64(z * t)) - Float64(Float64(Float64(a + Float64(b * c)) * c) * i))) end
function tmp = code(x, y, z, t, a, b, c, i) tmp = 2.0 * (((x * y) + (z * t)) - (((a + (b * c)) * c) * i)); end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(2.0 * N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] - N[(N[(N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision] * c), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
2 \cdot \left(\left(x \cdot y + z \cdot t\right) - \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i\right)
\end{array}
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ a (* b c))) (t_2 (+ (* z t) (* x y))))
(if (<= (- t_2 (* i (* c t_1))) INFINITY)
(* 2.0 (- t_2 (* t_1 (* c i))))
(* 2.0 (* c (* c (* b (- 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 = (z * t) + (x * y);
double tmp;
if ((t_2 - (i * (c * t_1))) <= ((double) INFINITY)) {
tmp = 2.0 * (t_2 - (t_1 * (c * i)));
} else {
tmp = 2.0 * (c * (c * (b * -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 = (z * t) + (x * y);
double tmp;
if ((t_2 - (i * (c * t_1))) <= Double.POSITIVE_INFINITY) {
tmp = 2.0 * (t_2 - (t_1 * (c * i)));
} else {
tmp = 2.0 * (c * (c * (b * -i)));
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = a + (b * c) t_2 = (z * t) + (x * y) tmp = 0 if (t_2 - (i * (c * t_1))) <= math.inf: tmp = 2.0 * (t_2 - (t_1 * (c * i))) else: tmp = 2.0 * (c * (c * (b * -i))) return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(a + Float64(b * c)) t_2 = Float64(Float64(z * t) + Float64(x * y)) tmp = 0.0 if (Float64(t_2 - Float64(i * Float64(c * t_1))) <= Inf) tmp = Float64(2.0 * Float64(t_2 - Float64(t_1 * Float64(c * i)))); else tmp = Float64(2.0 * Float64(c * Float64(c * Float64(b * Float64(-i))))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = a + (b * c); t_2 = (z * t) + (x * y); tmp = 0.0; if ((t_2 - (i * (c * t_1))) <= Inf) tmp = 2.0 * (t_2 - (t_1 * (c * i))); else tmp = 2.0 * (c * (c * (b * -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[(z * t), $MachinePrecision] + N[(x * y), $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[(t$95$1 * N[(c * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(c * N[(c * N[(b * (-i)), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a + b \cdot c\\
t_2 := z \cdot t + x \cdot y\\
\mathbf{if}\;t_2 - i \cdot \left(c \cdot t_1\right) \leq \infty:\\
\;\;\;\;2 \cdot \left(t_2 - t_1 \cdot \left(c \cdot i\right)\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(c \cdot \left(c \cdot \left(b \cdot \left(-i\right)\right)\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 90.6%
associate-*l*98.7%
fma-def98.7%
Simplified98.7%
fma-def98.7%
+-commutative98.7%
Applied egg-rr98.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 b around inf 50.1%
mul-1-neg50.1%
*-commutative50.1%
distribute-rgt-neg-in50.1%
unpow250.1%
distribute-rgt-neg-in50.1%
Simplified50.1%
expm1-log1p-u33.4%
expm1-udef33.5%
*-commutative33.5%
Applied egg-rr33.5%
expm1-def33.4%
expm1-log1p50.1%
*-commutative50.1%
associate-*r*50.2%
*-commutative50.2%
*-commutative50.2%
distribute-lft-neg-in50.2%
distribute-rgt-neg-in50.2%
distribute-rgt-neg-in50.2%
distribute-rgt-neg-in50.2%
Simplified50.2%
Final simplification96.5%
(FPCore (x y z t a b c i) :precision binary64 (* 2.0 (- (fma x y (* z t)) (* (+ a (* b c)) (* c i)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return 2.0 * (fma(x, y, (z * t)) - ((a + (b * c)) * (c * i)));
}
function code(x, y, z, t, a, b, c, i) return Float64(2.0 * Float64(fma(x, y, Float64(z * t)) - Float64(Float64(a + Float64(b * c)) * Float64(c * i)))) end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(2.0 * N[(N[(x * y + N[(z * t), $MachinePrecision]), $MachinePrecision] - N[(N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision] * N[(c * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
2 \cdot \left(\mathsf{fma}\left(x, y, z \cdot t\right) - \left(a + b \cdot c\right) \cdot \left(c \cdot i\right)\right)
\end{array}
Initial program 86.4%
associate-*l*94.5%
fma-def95.3%
Simplified95.3%
Final simplification95.3%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ a (* b c))) (t_2 (* i (* c t_1))))
(if (or (<= t_2 (- INFINITY)) (not (<= t_2 5e+300)))
(* 2.0 (* (* t_1 i) (- c)))
(* 2.0 (- (+ (* z t) (* x y)) 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 = i * (c * t_1);
double tmp;
if ((t_2 <= -((double) INFINITY)) || !(t_2 <= 5e+300)) {
tmp = 2.0 * ((t_1 * i) * -c);
} else {
tmp = 2.0 * (((z * t) + (x * y)) - 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 = i * (c * t_1);
double tmp;
if ((t_2 <= -Double.POSITIVE_INFINITY) || !(t_2 <= 5e+300)) {
tmp = 2.0 * ((t_1 * i) * -c);
} else {
tmp = 2.0 * (((z * t) + (x * y)) - t_2);
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = a + (b * c) t_2 = i * (c * t_1) tmp = 0 if (t_2 <= -math.inf) or not (t_2 <= 5e+300): tmp = 2.0 * ((t_1 * i) * -c) else: tmp = 2.0 * (((z * t) + (x * y)) - t_2) return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(a + Float64(b * c)) t_2 = Float64(i * Float64(c * t_1)) tmp = 0.0 if ((t_2 <= Float64(-Inf)) || !(t_2 <= 5e+300)) tmp = Float64(2.0 * Float64(Float64(t_1 * i) * Float64(-c))); else tmp = Float64(2.0 * Float64(Float64(Float64(z * t) + Float64(x * y)) - 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 = i * (c * t_1); tmp = 0.0; if ((t_2 <= -Inf) || ~((t_2 <= 5e+300))) tmp = 2.0 * ((t_1 * i) * -c); else tmp = 2.0 * (((z * t) + (x * y)) - 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[(i * N[(c * t$95$1), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[t$95$2, (-Infinity)], N[Not[LessEqual[t$95$2, 5e+300]], $MachinePrecision]], N[(2.0 * N[(N[(t$95$1 * i), $MachinePrecision] * (-c)), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[(N[(z * t), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision] - t$95$2), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a + b \cdot c\\
t_2 := i \cdot \left(c \cdot t_1\right)\\
\mathbf{if}\;t_2 \leq -\infty \lor \neg \left(t_2 \leq 5 \cdot 10^{+300}\right):\\
\;\;\;\;2 \cdot \left(\left(t_1 \cdot i\right) \cdot \left(-c\right)\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(\left(z \cdot t + x \cdot y\right) - t_2\right)\\
\end{array}
\end{array}
if (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < -inf.0 or 5.00000000000000026e300 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) Initial program 65.4%
Taylor expanded in i around inf 90.4%
if -inf.0 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 5.00000000000000026e300Initial program 98.5%
Final simplification95.5%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* 2.0 (- (* x y) (* i (* a c)))))
(t_2 (* 2.0 (+ (* z t) (* x y))))
(t_3 (* 2.0 (* (* (+ a (* b c)) i) (- c)))))
(if (<= c -5.3e+95)
t_3
(if (<= c 1.26e-301)
t_2
(if (<= c 7e-143)
t_1
(if (<= c 3.4e+45) t_2 (if (<= c 1.65e+59) t_1 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 * ((x * y) - (i * (a * c)));
double t_2 = 2.0 * ((z * t) + (x * y));
double t_3 = 2.0 * (((a + (b * c)) * i) * -c);
double tmp;
if (c <= -5.3e+95) {
tmp = t_3;
} else if (c <= 1.26e-301) {
tmp = t_2;
} else if (c <= 7e-143) {
tmp = t_1;
} else if (c <= 3.4e+45) {
tmp = t_2;
} else if (c <= 1.65e+59) {
tmp = t_1;
} 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 * ((x * y) - (i * (a * c)))
t_2 = 2.0d0 * ((z * t) + (x * y))
t_3 = 2.0d0 * (((a + (b * c)) * i) * -c)
if (c <= (-5.3d+95)) then
tmp = t_3
else if (c <= 1.26d-301) then
tmp = t_2
else if (c <= 7d-143) then
tmp = t_1
else if (c <= 3.4d+45) then
tmp = t_2
else if (c <= 1.65d+59) then
tmp = t_1
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 * ((x * y) - (i * (a * c)));
double t_2 = 2.0 * ((z * t) + (x * y));
double t_3 = 2.0 * (((a + (b * c)) * i) * -c);
double tmp;
if (c <= -5.3e+95) {
tmp = t_3;
} else if (c <= 1.26e-301) {
tmp = t_2;
} else if (c <= 7e-143) {
tmp = t_1;
} else if (c <= 3.4e+45) {
tmp = t_2;
} else if (c <= 1.65e+59) {
tmp = t_1;
} else {
tmp = t_3;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = 2.0 * ((x * y) - (i * (a * c))) t_2 = 2.0 * ((z * t) + (x * y)) t_3 = 2.0 * (((a + (b * c)) * i) * -c) tmp = 0 if c <= -5.3e+95: tmp = t_3 elif c <= 1.26e-301: tmp = t_2 elif c <= 7e-143: tmp = t_1 elif c <= 3.4e+45: tmp = t_2 elif c <= 1.65e+59: tmp = t_1 else: tmp = t_3 return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(2.0 * Float64(Float64(x * y) - Float64(i * Float64(a * c)))) t_2 = Float64(2.0 * Float64(Float64(z * t) + Float64(x * y))) t_3 = Float64(2.0 * Float64(Float64(Float64(a + Float64(b * c)) * i) * Float64(-c))) tmp = 0.0 if (c <= -5.3e+95) tmp = t_3; elseif (c <= 1.26e-301) tmp = t_2; elseif (c <= 7e-143) tmp = t_1; elseif (c <= 3.4e+45) tmp = t_2; elseif (c <= 1.65e+59) tmp = t_1; else tmp = t_3; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = 2.0 * ((x * y) - (i * (a * c))); t_2 = 2.0 * ((z * t) + (x * y)); t_3 = 2.0 * (((a + (b * c)) * i) * -c); tmp = 0.0; if (c <= -5.3e+95) tmp = t_3; elseif (c <= 1.26e-301) tmp = t_2; elseif (c <= 7e-143) tmp = t_1; elseif (c <= 3.4e+45) tmp = t_2; elseif (c <= 1.65e+59) tmp = t_1; 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[(N[(x * y), $MachinePrecision] - N[(i * N[(a * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(2.0 * N[(N[(z * t), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(2.0 * N[(N[(N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision] * i), $MachinePrecision] * (-c)), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[c, -5.3e+95], t$95$3, If[LessEqual[c, 1.26e-301], t$95$2, If[LessEqual[c, 7e-143], t$95$1, If[LessEqual[c, 3.4e+45], t$95$2, If[LessEqual[c, 1.65e+59], t$95$1, t$95$3]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := 2 \cdot \left(x \cdot y - i \cdot \left(a \cdot c\right)\right)\\
t_2 := 2 \cdot \left(z \cdot t + x \cdot y\right)\\
t_3 := 2 \cdot \left(\left(\left(a + b \cdot c\right) \cdot i\right) \cdot \left(-c\right)\right)\\
\mathbf{if}\;c \leq -5.3 \cdot 10^{+95}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;c \leq 1.26 \cdot 10^{-301}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;c \leq 7 \cdot 10^{-143}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;c \leq 3.4 \cdot 10^{+45}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;c \leq 1.65 \cdot 10^{+59}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_3\\
\end{array}
\end{array}
if c < -5.3000000000000002e95 or 1.65e59 < c Initial program 70.8%
Taylor expanded in i around inf 87.2%
if -5.3000000000000002e95 < c < 1.2599999999999999e-301 or 7.00000000000000011e-143 < c < 3.4e45Initial program 93.6%
Taylor expanded in c around 0 75.8%
if 1.2599999999999999e-301 < c < 7.00000000000000011e-143 or 3.4e45 < c < 1.65e59Initial program 99.4%
associate-*l*99.8%
fma-def99.8%
Simplified99.8%
fma-def99.8%
+-commutative99.8%
Applied egg-rr99.8%
Taylor expanded in a around inf 85.3%
*-commutative85.3%
associate-*l*97.1%
*-commutative97.1%
Simplified97.1%
Taylor expanded in z around 0 76.2%
associate-*r*88.0%
*-commutative88.0%
*-commutative88.0%
*-commutative88.0%
Simplified88.0%
Final simplification81.8%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* 2.0 (* x y)))
(t_2 (* -2.0 (* (* c c) (* b i))))
(t_3 (* 2.0 (* z t))))
(if (<= c -1.42e+110)
t_2
(if (<= c -7e-30)
t_1
(if (<= c -6.5e-161)
t_3
(if (<= c -2e-267)
t_1
(if (<= c 8.8e-303) t_3 (if (<= c 9.8e+58) t_1 t_2))))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = 2.0 * (x * y);
double t_2 = -2.0 * ((c * c) * (b * i));
double t_3 = 2.0 * (z * t);
double tmp;
if (c <= -1.42e+110) {
tmp = t_2;
} else if (c <= -7e-30) {
tmp = t_1;
} else if (c <= -6.5e-161) {
tmp = t_3;
} else if (c <= -2e-267) {
tmp = t_1;
} else if (c <= 8.8e-303) {
tmp = t_3;
} else if (c <= 9.8e+58) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: tmp
t_1 = 2.0d0 * (x * y)
t_2 = (-2.0d0) * ((c * c) * (b * i))
t_3 = 2.0d0 * (z * t)
if (c <= (-1.42d+110)) then
tmp = t_2
else if (c <= (-7d-30)) then
tmp = t_1
else if (c <= (-6.5d-161)) then
tmp = t_3
else if (c <= (-2d-267)) then
tmp = t_1
else if (c <= 8.8d-303) then
tmp = t_3
else if (c <= 9.8d+58) then
tmp = t_1
else
tmp = t_2
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = 2.0 * (x * y);
double t_2 = -2.0 * ((c * c) * (b * i));
double t_3 = 2.0 * (z * t);
double tmp;
if (c <= -1.42e+110) {
tmp = t_2;
} else if (c <= -7e-30) {
tmp = t_1;
} else if (c <= -6.5e-161) {
tmp = t_3;
} else if (c <= -2e-267) {
tmp = t_1;
} else if (c <= 8.8e-303) {
tmp = t_3;
} else if (c <= 9.8e+58) {
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) t_2 = -2.0 * ((c * c) * (b * i)) t_3 = 2.0 * (z * t) tmp = 0 if c <= -1.42e+110: tmp = t_2 elif c <= -7e-30: tmp = t_1 elif c <= -6.5e-161: tmp = t_3 elif c <= -2e-267: tmp = t_1 elif c <= 8.8e-303: tmp = t_3 elif c <= 9.8e+58: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(2.0 * Float64(x * y)) t_2 = Float64(-2.0 * Float64(Float64(c * c) * Float64(b * i))) t_3 = Float64(2.0 * Float64(z * t)) tmp = 0.0 if (c <= -1.42e+110) tmp = t_2; elseif (c <= -7e-30) tmp = t_1; elseif (c <= -6.5e-161) tmp = t_3; elseif (c <= -2e-267) tmp = t_1; elseif (c <= 8.8e-303) tmp = t_3; elseif (c <= 9.8e+58) tmp = t_1; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = 2.0 * (x * y); t_2 = -2.0 * ((c * c) * (b * i)); t_3 = 2.0 * (z * t); tmp = 0.0; if (c <= -1.42e+110) tmp = t_2; elseif (c <= -7e-30) tmp = t_1; elseif (c <= -6.5e-161) tmp = t_3; elseif (c <= -2e-267) tmp = t_1; elseif (c <= 8.8e-303) tmp = t_3; elseif (c <= 9.8e+58) tmp = t_1; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(2.0 * N[(x * y), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(-2.0 * N[(N[(c * c), $MachinePrecision] * N[(b * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(2.0 * N[(z * t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[c, -1.42e+110], t$95$2, If[LessEqual[c, -7e-30], t$95$1, If[LessEqual[c, -6.5e-161], t$95$3, If[LessEqual[c, -2e-267], t$95$1, If[LessEqual[c, 8.8e-303], t$95$3, If[LessEqual[c, 9.8e+58], t$95$1, t$95$2]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := 2 \cdot \left(x \cdot y\right)\\
t_2 := -2 \cdot \left(\left(c \cdot c\right) \cdot \left(b \cdot i\right)\right)\\
t_3 := 2 \cdot \left(z \cdot t\right)\\
\mathbf{if}\;c \leq -1.42 \cdot 10^{+110}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;c \leq -7 \cdot 10^{-30}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;c \leq -6.5 \cdot 10^{-161}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;c \leq -2 \cdot 10^{-267}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;c \leq 8.8 \cdot 10^{-303}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;c \leq 9.8 \cdot 10^{+58}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if c < -1.4200000000000001e110 or 9.80000000000000037e58 < c Initial program 71.2%
Taylor expanded in b around inf 61.5%
mul-1-neg61.5%
*-commutative61.5%
distribute-rgt-neg-in61.5%
unpow261.5%
distribute-rgt-neg-in61.5%
Simplified61.5%
Taylor expanded in i around 0 61.5%
unpow261.5%
Simplified61.5%
if -1.4200000000000001e110 < c < -7.0000000000000006e-30 or -6.50000000000000008e-161 < c < -2e-267 or 8.80000000000000055e-303 < c < 9.80000000000000037e58Initial program 94.2%
Taylor expanded in x around inf 49.6%
if -7.0000000000000006e-30 < c < -6.50000000000000008e-161 or -2e-267 < c < 8.80000000000000055e-303Initial program 95.3%
Taylor expanded in z around inf 61.5%
Final simplification55.7%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* 2.0 (- (* x y) (* i (* a c)))))
(t_2 (* 2.0 (+ (* z t) (* x y))))
(t_3 (* 2.0 (* c (* c (* b (- i)))))))
(if (<= c -8.5e+121)
t_3
(if (<= c 1.26e-301)
t_2
(if (<= c 2.6e-143)
t_1
(if (<= c 7e+44) t_2 (if (<= c 9.5e+85) t_1 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 * ((x * y) - (i * (a * c)));
double t_2 = 2.0 * ((z * t) + (x * y));
double t_3 = 2.0 * (c * (c * (b * -i)));
double tmp;
if (c <= -8.5e+121) {
tmp = t_3;
} else if (c <= 1.26e-301) {
tmp = t_2;
} else if (c <= 2.6e-143) {
tmp = t_1;
} else if (c <= 7e+44) {
tmp = t_2;
} else if (c <= 9.5e+85) {
tmp = t_1;
} 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 * ((x * y) - (i * (a * c)))
t_2 = 2.0d0 * ((z * t) + (x * y))
t_3 = 2.0d0 * (c * (c * (b * -i)))
if (c <= (-8.5d+121)) then
tmp = t_3
else if (c <= 1.26d-301) then
tmp = t_2
else if (c <= 2.6d-143) then
tmp = t_1
else if (c <= 7d+44) then
tmp = t_2
else if (c <= 9.5d+85) then
tmp = t_1
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 * ((x * y) - (i * (a * c)));
double t_2 = 2.0 * ((z * t) + (x * y));
double t_3 = 2.0 * (c * (c * (b * -i)));
double tmp;
if (c <= -8.5e+121) {
tmp = t_3;
} else if (c <= 1.26e-301) {
tmp = t_2;
} else if (c <= 2.6e-143) {
tmp = t_1;
} else if (c <= 7e+44) {
tmp = t_2;
} else if (c <= 9.5e+85) {
tmp = t_1;
} else {
tmp = t_3;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = 2.0 * ((x * y) - (i * (a * c))) t_2 = 2.0 * ((z * t) + (x * y)) t_3 = 2.0 * (c * (c * (b * -i))) tmp = 0 if c <= -8.5e+121: tmp = t_3 elif c <= 1.26e-301: tmp = t_2 elif c <= 2.6e-143: tmp = t_1 elif c <= 7e+44: tmp = t_2 elif c <= 9.5e+85: tmp = t_1 else: tmp = t_3 return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(2.0 * Float64(Float64(x * y) - Float64(i * Float64(a * c)))) t_2 = Float64(2.0 * Float64(Float64(z * t) + Float64(x * y))) t_3 = Float64(2.0 * Float64(c * Float64(c * Float64(b * Float64(-i))))) tmp = 0.0 if (c <= -8.5e+121) tmp = t_3; elseif (c <= 1.26e-301) tmp = t_2; elseif (c <= 2.6e-143) tmp = t_1; elseif (c <= 7e+44) tmp = t_2; elseif (c <= 9.5e+85) tmp = t_1; else tmp = t_3; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = 2.0 * ((x * y) - (i * (a * c))); t_2 = 2.0 * ((z * t) + (x * y)); t_3 = 2.0 * (c * (c * (b * -i))); tmp = 0.0; if (c <= -8.5e+121) tmp = t_3; elseif (c <= 1.26e-301) tmp = t_2; elseif (c <= 2.6e-143) tmp = t_1; elseif (c <= 7e+44) tmp = t_2; elseif (c <= 9.5e+85) tmp = t_1; 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[(N[(x * y), $MachinePrecision] - N[(i * N[(a * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(2.0 * N[(N[(z * t), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(2.0 * N[(c * N[(c * N[(b * (-i)), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[c, -8.5e+121], t$95$3, If[LessEqual[c, 1.26e-301], t$95$2, If[LessEqual[c, 2.6e-143], t$95$1, If[LessEqual[c, 7e+44], t$95$2, If[LessEqual[c, 9.5e+85], t$95$1, t$95$3]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := 2 \cdot \left(x \cdot y - i \cdot \left(a \cdot c\right)\right)\\
t_2 := 2 \cdot \left(z \cdot t + x \cdot y\right)\\
t_3 := 2 \cdot \left(c \cdot \left(c \cdot \left(b \cdot \left(-i\right)\right)\right)\right)\\
\mathbf{if}\;c \leq -8.5 \cdot 10^{+121}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;c \leq 1.26 \cdot 10^{-301}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;c \leq 2.6 \cdot 10^{-143}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;c \leq 7 \cdot 10^{+44}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;c \leq 9.5 \cdot 10^{+85}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_3\\
\end{array}
\end{array}
if c < -8.5e121 or 9.49999999999999945e85 < c Initial program 72.2%
Taylor expanded in b around inf 64.1%
mul-1-neg64.1%
*-commutative64.1%
distribute-rgt-neg-in64.1%
unpow264.1%
distribute-rgt-neg-in64.1%
Simplified64.1%
expm1-log1p-u31.8%
expm1-udef31.8%
*-commutative31.8%
Applied egg-rr31.8%
expm1-def31.8%
expm1-log1p64.1%
*-commutative64.1%
associate-*r*68.8%
*-commutative68.8%
*-commutative68.8%
distribute-lft-neg-in68.8%
distribute-rgt-neg-in68.8%
distribute-rgt-neg-in68.8%
distribute-rgt-neg-in68.8%
Simplified68.8%
if -8.5e121 < c < 1.2599999999999999e-301 or 2.59999999999999987e-143 < c < 6.9999999999999998e44Initial program 93.0%
Taylor expanded in c around 0 75.1%
if 1.2599999999999999e-301 < c < 2.59999999999999987e-143 or 6.9999999999999998e44 < c < 9.49999999999999945e85Initial program 93.1%
associate-*l*97.6%
fma-def97.6%
Simplified97.6%
fma-def97.6%
+-commutative97.6%
Applied egg-rr97.6%
Taylor expanded in a around inf 82.5%
*-commutative82.5%
associate-*l*93.0%
*-commutative93.0%
Simplified93.0%
Taylor expanded in z around 0 74.4%
associate-*r*82.9%
*-commutative82.9%
*-commutative82.9%
*-commutative82.9%
Simplified82.9%
Final simplification74.4%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= c -5.2e+121) (not (<= c 6.2e+62))) (* 2.0 (* (* (+ a (* b c)) i) (- c))) (* 2.0 (- (+ (* z t) (* x y)) (* i (* a c))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((c <= -5.2e+121) || !(c <= 6.2e+62)) {
tmp = 2.0 * (((a + (b * c)) * i) * -c);
} else {
tmp = 2.0 * (((z * t) + (x * y)) - (i * (a * c)));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: tmp
if ((c <= (-5.2d+121)) .or. (.not. (c <= 6.2d+62))) then
tmp = 2.0d0 * (((a + (b * c)) * i) * -c)
else
tmp = 2.0d0 * (((z * t) + (x * y)) - (i * (a * c)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((c <= -5.2e+121) || !(c <= 6.2e+62)) {
tmp = 2.0 * (((a + (b * c)) * i) * -c);
} else {
tmp = 2.0 * (((z * t) + (x * y)) - (i * (a * c)));
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if (c <= -5.2e+121) or not (c <= 6.2e+62): tmp = 2.0 * (((a + (b * c)) * i) * -c) else: tmp = 2.0 * (((z * t) + (x * y)) - (i * (a * c))) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if ((c <= -5.2e+121) || !(c <= 6.2e+62)) tmp = Float64(2.0 * Float64(Float64(Float64(a + Float64(b * c)) * i) * Float64(-c))); else tmp = Float64(2.0 * Float64(Float64(Float64(z * t) + Float64(x * y)) - Float64(i * Float64(a * c)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if ((c <= -5.2e+121) || ~((c <= 6.2e+62))) tmp = 2.0 * (((a + (b * c)) * i) * -c); else tmp = 2.0 * (((z * t) + (x * y)) - (i * (a * c))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[c, -5.2e+121], N[Not[LessEqual[c, 6.2e+62]], $MachinePrecision]], N[(2.0 * N[(N[(N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision] * i), $MachinePrecision] * (-c)), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[(N[(z * t), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision] - N[(i * N[(a * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;c \leq -5.2 \cdot 10^{+121} \lor \neg \left(c \leq 6.2 \cdot 10^{+62}\right):\\
\;\;\;\;2 \cdot \left(\left(\left(a + b \cdot c\right) \cdot i\right) \cdot \left(-c\right)\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(\left(z \cdot t + x \cdot y\right) - i \cdot \left(a \cdot c\right)\right)\\
\end{array}
\end{array}
if c < -5.1999999999999998e121 or 6.20000000000000029e62 < c Initial program 70.5%
Taylor expanded in i around inf 88.7%
if -5.1999999999999998e121 < c < 6.20000000000000029e62Initial program 94.5%
Taylor expanded in a around inf 91.0%
Final simplification90.3%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= c -2.1e+122) (not (<= c 6.2e+62))) (* 2.0 (* (* (+ a (* b c)) i) (- c))) (* 2.0 (- (+ (* z t) (* x y)) (* a (* c i))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((c <= -2.1e+122) || !(c <= 6.2e+62)) {
tmp = 2.0 * (((a + (b * c)) * i) * -c);
} else {
tmp = 2.0 * (((z * t) + (x * y)) - (a * (c * i)));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: tmp
if ((c <= (-2.1d+122)) .or. (.not. (c <= 6.2d+62))) then
tmp = 2.0d0 * (((a + (b * c)) * i) * -c)
else
tmp = 2.0d0 * (((z * t) + (x * y)) - (a * (c * i)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((c <= -2.1e+122) || !(c <= 6.2e+62)) {
tmp = 2.0 * (((a + (b * c)) * i) * -c);
} else {
tmp = 2.0 * (((z * t) + (x * y)) - (a * (c * i)));
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if (c <= -2.1e+122) or not (c <= 6.2e+62): tmp = 2.0 * (((a + (b * c)) * i) * -c) else: tmp = 2.0 * (((z * t) + (x * y)) - (a * (c * i))) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if ((c <= -2.1e+122) || !(c <= 6.2e+62)) tmp = Float64(2.0 * Float64(Float64(Float64(a + Float64(b * c)) * i) * Float64(-c))); else tmp = Float64(2.0 * Float64(Float64(Float64(z * t) + Float64(x * y)) - Float64(a * Float64(c * i)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if ((c <= -2.1e+122) || ~((c <= 6.2e+62))) tmp = 2.0 * (((a + (b * c)) * i) * -c); else tmp = 2.0 * (((z * t) + (x * y)) - (a * (c * i))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[c, -2.1e+122], N[Not[LessEqual[c, 6.2e+62]], $MachinePrecision]], N[(2.0 * N[(N[(N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision] * i), $MachinePrecision] * (-c)), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[(N[(z * t), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision] - N[(a * N[(c * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;c \leq -2.1 \cdot 10^{+122} \lor \neg \left(c \leq 6.2 \cdot 10^{+62}\right):\\
\;\;\;\;2 \cdot \left(\left(\left(a + b \cdot c\right) \cdot i\right) \cdot \left(-c\right)\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(\left(z \cdot t + x \cdot y\right) - a \cdot \left(c \cdot i\right)\right)\\
\end{array}
\end{array}
if c < -2.10000000000000016e122 or 6.20000000000000029e62 < c Initial program 70.5%
Taylor expanded in i around inf 88.7%
if -2.10000000000000016e122 < c < 6.20000000000000029e62Initial program 94.5%
associate-*l*95.3%
fma-def96.4%
Simplified96.4%
fma-def95.3%
+-commutative95.3%
Applied egg-rr95.3%
Taylor expanded in a around inf 87.2%
*-commutative87.2%
associate-*l*91.1%
*-commutative91.1%
Simplified91.1%
Final simplification90.3%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* 2.0 (* z t))) (t_2 (* 2.0 (* x y))))
(if (<= a -5.8e+127)
(* c (* -2.0 (* a i)))
(if (<= a -1.95e+56)
t_1
(if (<= a -3.4e-272)
t_2
(if (<= a 2.6e-106)
t_1
(if (<= a 5e+137) t_2 (* (* c i) (* a -2.0)))))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = 2.0 * (z * t);
double t_2 = 2.0 * (x * y);
double tmp;
if (a <= -5.8e+127) {
tmp = c * (-2.0 * (a * i));
} else if (a <= -1.95e+56) {
tmp = t_1;
} else if (a <= -3.4e-272) {
tmp = t_2;
} else if (a <= 2.6e-106) {
tmp = t_1;
} else if (a <= 5e+137) {
tmp = t_2;
} else {
tmp = (c * i) * (a * -2.0);
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = 2.0d0 * (z * t)
t_2 = 2.0d0 * (x * y)
if (a <= (-5.8d+127)) then
tmp = c * ((-2.0d0) * (a * i))
else if (a <= (-1.95d+56)) then
tmp = t_1
else if (a <= (-3.4d-272)) then
tmp = t_2
else if (a <= 2.6d-106) then
tmp = t_1
else if (a <= 5d+137) then
tmp = t_2
else
tmp = (c * i) * (a * (-2.0d0))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = 2.0 * (z * t);
double t_2 = 2.0 * (x * y);
double tmp;
if (a <= -5.8e+127) {
tmp = c * (-2.0 * (a * i));
} else if (a <= -1.95e+56) {
tmp = t_1;
} else if (a <= -3.4e-272) {
tmp = t_2;
} else if (a <= 2.6e-106) {
tmp = t_1;
} else if (a <= 5e+137) {
tmp = t_2;
} else {
tmp = (c * i) * (a * -2.0);
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = 2.0 * (z * t) t_2 = 2.0 * (x * y) tmp = 0 if a <= -5.8e+127: tmp = c * (-2.0 * (a * i)) elif a <= -1.95e+56: tmp = t_1 elif a <= -3.4e-272: tmp = t_2 elif a <= 2.6e-106: tmp = t_1 elif a <= 5e+137: tmp = t_2 else: tmp = (c * i) * (a * -2.0) return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(2.0 * Float64(z * t)) t_2 = Float64(2.0 * Float64(x * y)) tmp = 0.0 if (a <= -5.8e+127) tmp = Float64(c * Float64(-2.0 * Float64(a * i))); elseif (a <= -1.95e+56) tmp = t_1; elseif (a <= -3.4e-272) tmp = t_2; elseif (a <= 2.6e-106) tmp = t_1; elseif (a <= 5e+137) tmp = t_2; else tmp = Float64(Float64(c * i) * Float64(a * -2.0)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = 2.0 * (z * t); t_2 = 2.0 * (x * y); tmp = 0.0; if (a <= -5.8e+127) tmp = c * (-2.0 * (a * i)); elseif (a <= -1.95e+56) tmp = t_1; elseif (a <= -3.4e-272) tmp = t_2; elseif (a <= 2.6e-106) tmp = t_1; elseif (a <= 5e+137) tmp = t_2; else tmp = (c * i) * (a * -2.0); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(2.0 * N[(z * t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(2.0 * N[(x * y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -5.8e+127], N[(c * N[(-2.0 * N[(a * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, -1.95e+56], t$95$1, If[LessEqual[a, -3.4e-272], t$95$2, If[LessEqual[a, 2.6e-106], t$95$1, If[LessEqual[a, 5e+137], t$95$2, N[(N[(c * i), $MachinePrecision] * N[(a * -2.0), $MachinePrecision]), $MachinePrecision]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := 2 \cdot \left(z \cdot t\right)\\
t_2 := 2 \cdot \left(x \cdot y\right)\\
\mathbf{if}\;a \leq -5.8 \cdot 10^{+127}:\\
\;\;\;\;c \cdot \left(-2 \cdot \left(a \cdot i\right)\right)\\
\mathbf{elif}\;a \leq -1.95 \cdot 10^{+56}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;a \leq -3.4 \cdot 10^{-272}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;a \leq 2.6 \cdot 10^{-106}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;a \leq 5 \cdot 10^{+137}:\\
\;\;\;\;t_2\\
\mathbf{else}:\\
\;\;\;\;\left(c \cdot i\right) \cdot \left(a \cdot -2\right)\\
\end{array}
\end{array}
if a < -5.8000000000000004e127Initial program 79.3%
associate-*l*94.4%
fma-def99.8%
Simplified99.8%
fma-def94.4%
+-commutative94.4%
Applied egg-rr94.4%
Taylor expanded in a around inf 89.1%
*-commutative89.1%
associate-*l*89.2%
*-commutative89.2%
Simplified89.2%
Taylor expanded in a around inf 63.9%
associate-*r*63.9%
*-commutative63.9%
*-commutative63.9%
associate-*l*63.9%
*-commutative63.9%
associate-*l*63.9%
Simplified63.9%
if -5.8000000000000004e127 < a < -1.94999999999999997e56 or -3.4000000000000003e-272 < a < 2.6000000000000001e-106Initial program 91.0%
Taylor expanded in z around inf 42.5%
if -1.94999999999999997e56 < a < -3.4000000000000003e-272 or 2.6000000000000001e-106 < a < 5.0000000000000002e137Initial program 85.4%
Taylor expanded in x around inf 44.3%
if 5.0000000000000002e137 < a Initial program 87.6%
associate-*l*95.6%
fma-def95.6%
Simplified95.6%
fma-def95.6%
+-commutative95.6%
Applied egg-rr95.6%
Taylor expanded in a around inf 75.5%
*-commutative75.5%
associate-*l*87.4%
*-commutative87.4%
Simplified87.4%
Taylor expanded in a around inf 49.0%
associate-*r*49.0%
*-commutative49.0%
*-commutative49.0%
associate-*l*49.0%
*-commutative49.0%
associate-*l*49.0%
Simplified49.0%
expm1-log1p-u17.2%
expm1-udef17.2%
associate-*l*17.2%
Applied egg-rr17.2%
expm1-def17.2%
expm1-log1p49.0%
associate-*r*58.9%
*-commutative58.9%
*-commutative58.9%
Simplified58.9%
Final simplification49.3%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= c -8e+123) (not (<= c 3.9e+62))) (* 2.0 (* c (* c (* b (- i))))) (* 2.0 (+ (* z t) (* x y)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((c <= -8e+123) || !(c <= 3.9e+62)) {
tmp = 2.0 * (c * (c * (b * -i)));
} else {
tmp = 2.0 * ((z * t) + (x * y));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: tmp
if ((c <= (-8d+123)) .or. (.not. (c <= 3.9d+62))) then
tmp = 2.0d0 * (c * (c * (b * -i)))
else
tmp = 2.0d0 * ((z * t) + (x * y))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((c <= -8e+123) || !(c <= 3.9e+62)) {
tmp = 2.0 * (c * (c * (b * -i)));
} else {
tmp = 2.0 * ((z * t) + (x * y));
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if (c <= -8e+123) or not (c <= 3.9e+62): tmp = 2.0 * (c * (c * (b * -i))) else: tmp = 2.0 * ((z * t) + (x * y)) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if ((c <= -8e+123) || !(c <= 3.9e+62)) tmp = Float64(2.0 * Float64(c * Float64(c * Float64(b * Float64(-i))))); else tmp = Float64(2.0 * Float64(Float64(z * t) + Float64(x * y))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if ((c <= -8e+123) || ~((c <= 3.9e+62))) tmp = 2.0 * (c * (c * (b * -i))); else tmp = 2.0 * ((z * t) + (x * y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[c, -8e+123], N[Not[LessEqual[c, 3.9e+62]], $MachinePrecision]], N[(2.0 * N[(c * N[(c * N[(b * (-i)), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[(z * t), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;c \leq -8 \cdot 10^{+123} \lor \neg \left(c \leq 3.9 \cdot 10^{+62}\right):\\
\;\;\;\;2 \cdot \left(c \cdot \left(c \cdot \left(b \cdot \left(-i\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(z \cdot t + x \cdot y\right)\\
\end{array}
\end{array}
if c < -7.99999999999999982e123 or 3.9e62 < c Initial program 70.5%
Taylor expanded in b around inf 62.8%
mul-1-neg62.8%
*-commutative62.8%
distribute-rgt-neg-in62.8%
unpow262.8%
distribute-rgt-neg-in62.8%
Simplified62.8%
expm1-log1p-u32.3%
expm1-udef32.4%
*-commutative32.4%
Applied egg-rr32.4%
expm1-def32.3%
expm1-log1p62.8%
*-commutative62.8%
associate-*r*67.2%
*-commutative67.2%
*-commutative67.2%
distribute-lft-neg-in67.2%
distribute-rgt-neg-in67.2%
distribute-rgt-neg-in67.2%
distribute-rgt-neg-in67.2%
Simplified67.2%
if -7.99999999999999982e123 < c < 3.9e62Initial program 94.5%
Taylor expanded in c around 0 72.0%
Final simplification70.4%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* 2.0 (* z t))) (t_2 (* 2.0 (* x y))))
(if (<= y -3.4e-53)
t_2
(if (<= y -6.2e-261)
t_1
(if (<= y 2.7e-247)
(* c (* -2.0 (* a i)))
(if (<= y 4.2e+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 * (z * t);
double t_2 = 2.0 * (x * y);
double tmp;
if (y <= -3.4e-53) {
tmp = t_2;
} else if (y <= -6.2e-261) {
tmp = t_1;
} else if (y <= 2.7e-247) {
tmp = c * (-2.0 * (a * i));
} else if (y <= 4.2e+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 * (z * t)
t_2 = 2.0d0 * (x * y)
if (y <= (-3.4d-53)) then
tmp = t_2
else if (y <= (-6.2d-261)) then
tmp = t_1
else if (y <= 2.7d-247) then
tmp = c * ((-2.0d0) * (a * i))
else if (y <= 4.2d+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 * (z * t);
double t_2 = 2.0 * (x * y);
double tmp;
if (y <= -3.4e-53) {
tmp = t_2;
} else if (y <= -6.2e-261) {
tmp = t_1;
} else if (y <= 2.7e-247) {
tmp = c * (-2.0 * (a * i));
} else if (y <= 4.2e+68) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = 2.0 * (z * t) t_2 = 2.0 * (x * y) tmp = 0 if y <= -3.4e-53: tmp = t_2 elif y <= -6.2e-261: tmp = t_1 elif y <= 2.7e-247: tmp = c * (-2.0 * (a * i)) elif y <= 4.2e+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(z * t)) t_2 = Float64(2.0 * Float64(x * y)) tmp = 0.0 if (y <= -3.4e-53) tmp = t_2; elseif (y <= -6.2e-261) tmp = t_1; elseif (y <= 2.7e-247) tmp = Float64(c * Float64(-2.0 * Float64(a * i))); elseif (y <= 4.2e+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 * (z * t); t_2 = 2.0 * (x * y); tmp = 0.0; if (y <= -3.4e-53) tmp = t_2; elseif (y <= -6.2e-261) tmp = t_1; elseif (y <= 2.7e-247) tmp = c * (-2.0 * (a * i)); elseif (y <= 4.2e+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[(z * t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(2.0 * N[(x * y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -3.4e-53], t$95$2, If[LessEqual[y, -6.2e-261], t$95$1, If[LessEqual[y, 2.7e-247], N[(c * N[(-2.0 * N[(a * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 4.2e+68], t$95$1, t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := 2 \cdot \left(z \cdot t\right)\\
t_2 := 2 \cdot \left(x \cdot y\right)\\
\mathbf{if}\;y \leq -3.4 \cdot 10^{-53}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;y \leq -6.2 \cdot 10^{-261}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq 2.7 \cdot 10^{-247}:\\
\;\;\;\;c \cdot \left(-2 \cdot \left(a \cdot i\right)\right)\\
\mathbf{elif}\;y \leq 4.2 \cdot 10^{+68}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if y < -3.4e-53 or 4.20000000000000002e68 < y Initial program 88.3%
Taylor expanded in x around inf 46.7%
if -3.4e-53 < y < -6.1999999999999997e-261 or 2.70000000000000008e-247 < y < 4.20000000000000002e68Initial program 84.0%
Taylor expanded in z around inf 33.6%
if -6.1999999999999997e-261 < y < 2.70000000000000008e-247Initial program 85.7%
associate-*l*94.9%
fma-def94.9%
Simplified94.9%
fma-def94.9%
+-commutative94.9%
Applied egg-rr94.9%
Taylor expanded in a around inf 80.2%
*-commutative80.2%
associate-*l*75.3%
*-commutative75.3%
Simplified75.3%
Taylor expanded in a around inf 41.3%
associate-*r*41.3%
*-commutative41.3%
*-commutative41.3%
associate-*l*41.3%
*-commutative41.3%
associate-*l*41.3%
Simplified41.3%
Final simplification41.0%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* 2.0 (* z t))) (t_2 (* 2.0 (* x y))))
(if (<= y -1.7e-62)
t_2
(if (<= y -6.5e-261)
t_1
(if (<= y 1.28e-247)
(* i (* (* a c) -2.0))
(if (<= y 7.2e+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 * (z * t);
double t_2 = 2.0 * (x * y);
double tmp;
if (y <= -1.7e-62) {
tmp = t_2;
} else if (y <= -6.5e-261) {
tmp = t_1;
} else if (y <= 1.28e-247) {
tmp = i * ((a * c) * -2.0);
} else if (y <= 7.2e+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 * (z * t)
t_2 = 2.0d0 * (x * y)
if (y <= (-1.7d-62)) then
tmp = t_2
else if (y <= (-6.5d-261)) then
tmp = t_1
else if (y <= 1.28d-247) then
tmp = i * ((a * c) * (-2.0d0))
else if (y <= 7.2d+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 * (z * t);
double t_2 = 2.0 * (x * y);
double tmp;
if (y <= -1.7e-62) {
tmp = t_2;
} else if (y <= -6.5e-261) {
tmp = t_1;
} else if (y <= 1.28e-247) {
tmp = i * ((a * c) * -2.0);
} else if (y <= 7.2e+68) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = 2.0 * (z * t) t_2 = 2.0 * (x * y) tmp = 0 if y <= -1.7e-62: tmp = t_2 elif y <= -6.5e-261: tmp = t_1 elif y <= 1.28e-247: tmp = i * ((a * c) * -2.0) elif y <= 7.2e+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(z * t)) t_2 = Float64(2.0 * Float64(x * y)) tmp = 0.0 if (y <= -1.7e-62) tmp = t_2; elseif (y <= -6.5e-261) tmp = t_1; elseif (y <= 1.28e-247) tmp = Float64(i * Float64(Float64(a * c) * -2.0)); elseif (y <= 7.2e+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 * (z * t); t_2 = 2.0 * (x * y); tmp = 0.0; if (y <= -1.7e-62) tmp = t_2; elseif (y <= -6.5e-261) tmp = t_1; elseif (y <= 1.28e-247) tmp = i * ((a * c) * -2.0); elseif (y <= 7.2e+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[(z * t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(2.0 * N[(x * y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -1.7e-62], t$95$2, If[LessEqual[y, -6.5e-261], t$95$1, If[LessEqual[y, 1.28e-247], N[(i * N[(N[(a * c), $MachinePrecision] * -2.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 7.2e+68], t$95$1, t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := 2 \cdot \left(z \cdot t\right)\\
t_2 := 2 \cdot \left(x \cdot y\right)\\
\mathbf{if}\;y \leq -1.7 \cdot 10^{-62}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;y \leq -6.5 \cdot 10^{-261}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq 1.28 \cdot 10^{-247}:\\
\;\;\;\;i \cdot \left(\left(a \cdot c\right) \cdot -2\right)\\
\mathbf{elif}\;y \leq 7.2 \cdot 10^{+68}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if y < -1.69999999999999994e-62 or 7.1999999999999998e68 < y Initial program 87.7%
Taylor expanded in x around inf 46.3%
if -1.69999999999999994e-62 < y < -6.49999999999999984e-261 or 1.28000000000000007e-247 < y < 7.1999999999999998e68Initial program 84.7%
Taylor expanded in z around inf 33.9%
if -6.49999999999999984e-261 < y < 1.28000000000000007e-247Initial program 85.7%
associate-*l*94.9%
fma-def94.9%
Simplified94.9%
fma-def94.9%
+-commutative94.9%
Applied egg-rr94.9%
Taylor expanded in a around inf 80.2%
*-commutative80.2%
associate-*l*75.3%
*-commutative75.3%
Simplified75.3%
Taylor expanded in a around inf 41.3%
associate-*r*41.3%
*-commutative41.3%
*-commutative41.3%
associate-*l*41.3%
associate-*r*36.8%
associate-*l*36.8%
*-commutative36.8%
Simplified36.8%
Final simplification40.7%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= c -1.65e+123) (not (<= c 6e+62))) (* -2.0 (* (* c c) (* b i))) (* 2.0 (+ (* z t) (* x y)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((c <= -1.65e+123) || !(c <= 6e+62)) {
tmp = -2.0 * ((c * c) * (b * i));
} else {
tmp = 2.0 * ((z * t) + (x * y));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: tmp
if ((c <= (-1.65d+123)) .or. (.not. (c <= 6d+62))) then
tmp = (-2.0d0) * ((c * c) * (b * i))
else
tmp = 2.0d0 * ((z * t) + (x * y))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((c <= -1.65e+123) || !(c <= 6e+62)) {
tmp = -2.0 * ((c * c) * (b * i));
} else {
tmp = 2.0 * ((z * t) + (x * y));
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if (c <= -1.65e+123) or not (c <= 6e+62): tmp = -2.0 * ((c * c) * (b * i)) else: tmp = 2.0 * ((z * t) + (x * y)) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if ((c <= -1.65e+123) || !(c <= 6e+62)) tmp = Float64(-2.0 * Float64(Float64(c * c) * Float64(b * i))); else tmp = Float64(2.0 * Float64(Float64(z * t) + Float64(x * y))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if ((c <= -1.65e+123) || ~((c <= 6e+62))) tmp = -2.0 * ((c * c) * (b * i)); else tmp = 2.0 * ((z * t) + (x * y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[c, -1.65e+123], N[Not[LessEqual[c, 6e+62]], $MachinePrecision]], N[(-2.0 * N[(N[(c * c), $MachinePrecision] * N[(b * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[(z * t), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;c \leq -1.65 \cdot 10^{+123} \lor \neg \left(c \leq 6 \cdot 10^{+62}\right):\\
\;\;\;\;-2 \cdot \left(\left(c \cdot c\right) \cdot \left(b \cdot i\right)\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(z \cdot t + x \cdot y\right)\\
\end{array}
\end{array}
if c < -1.65000000000000001e123 or 6e62 < c Initial program 70.5%
Taylor expanded in b around inf 62.8%
mul-1-neg62.8%
*-commutative62.8%
distribute-rgt-neg-in62.8%
unpow262.8%
distribute-rgt-neg-in62.8%
Simplified62.8%
Taylor expanded in i around 0 62.8%
unpow262.8%
Simplified62.8%
if -1.65000000000000001e123 < c < 6e62Initial program 94.5%
Taylor expanded in c around 0 72.0%
Final simplification68.8%
(FPCore (x y z t a b c i)
:precision binary64
(if (<= c -1.25e+123)
(* 2.0 (* b (* i (* c (- c)))))
(if (<= c 1.2e+62)
(* 2.0 (+ (* z t) (* x y)))
(* -2.0 (* (* 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 (c <= -1.25e+123) {
tmp = 2.0 * (b * (i * (c * -c)));
} else if (c <= 1.2e+62) {
tmp = 2.0 * ((z * t) + (x * y));
} else {
tmp = -2.0 * ((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 (c <= (-1.25d+123)) then
tmp = 2.0d0 * (b * (i * (c * -c)))
else if (c <= 1.2d+62) then
tmp = 2.0d0 * ((z * t) + (x * y))
else
tmp = (-2.0d0) * ((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 (c <= -1.25e+123) {
tmp = 2.0 * (b * (i * (c * -c)));
} else if (c <= 1.2e+62) {
tmp = 2.0 * ((z * t) + (x * y));
} else {
tmp = -2.0 * ((c * c) * (b * i));
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if c <= -1.25e+123: tmp = 2.0 * (b * (i * (c * -c))) elif c <= 1.2e+62: tmp = 2.0 * ((z * t) + (x * y)) else: tmp = -2.0 * ((c * c) * (b * i)) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (c <= -1.25e+123) tmp = Float64(2.0 * Float64(b * Float64(i * Float64(c * Float64(-c))))); elseif (c <= 1.2e+62) tmp = Float64(2.0 * Float64(Float64(z * t) + Float64(x * y))); else tmp = Float64(-2.0 * Float64(Float64(c * c) * Float64(b * i))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if (c <= -1.25e+123) tmp = 2.0 * (b * (i * (c * -c))); elseif (c <= 1.2e+62) tmp = 2.0 * ((z * t) + (x * y)); else tmp = -2.0 * ((c * c) * (b * i)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[c, -1.25e+123], N[(2.0 * N[(b * N[(i * N[(c * (-c)), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[c, 1.2e+62], N[(2.0 * N[(N[(z * t), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(-2.0 * N[(N[(c * c), $MachinePrecision] * N[(b * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;c \leq -1.25 \cdot 10^{+123}:\\
\;\;\;\;2 \cdot \left(b \cdot \left(i \cdot \left(c \cdot \left(-c\right)\right)\right)\right)\\
\mathbf{elif}\;c \leq 1.2 \cdot 10^{+62}:\\
\;\;\;\;2 \cdot \left(z \cdot t + x \cdot y\right)\\
\mathbf{else}:\\
\;\;\;\;-2 \cdot \left(\left(c \cdot c\right) \cdot \left(b \cdot i\right)\right)\\
\end{array}
\end{array}
if c < -1.24999999999999994e123Initial program 78.6%
Taylor expanded in b around inf 67.8%
mul-1-neg67.8%
*-commutative67.8%
distribute-rgt-neg-in67.8%
unpow267.8%
distribute-rgt-neg-in67.8%
Simplified67.8%
expm1-log1p-u32.4%
expm1-udef32.4%
*-commutative32.4%
Applied egg-rr32.4%
expm1-def32.4%
expm1-log1p67.8%
*-commutative67.8%
*-commutative67.8%
distribute-rgt-neg-out67.8%
unpow267.8%
distribute-lft-neg-in67.8%
associate-*r*70.9%
unpow270.9%
distribute-lft-neg-in70.9%
*-commutative70.9%
Simplified70.9%
if -1.24999999999999994e123 < c < 1.2e62Initial program 94.5%
Taylor expanded in c around 0 72.0%
if 1.2e62 < c Initial program 63.6%
Taylor expanded in b around inf 58.5%
mul-1-neg58.5%
*-commutative58.5%
distribute-rgt-neg-in58.5%
unpow258.5%
distribute-rgt-neg-in58.5%
Simplified58.5%
Taylor expanded in i around 0 58.5%
unpow258.5%
Simplified58.5%
Final simplification69.3%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= y -7e-54) (not (<= y 5.5e+68))) (* 2.0 (* x y)) (* 2.0 (* z t))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((y <= -7e-54) || !(y <= 5.5e+68)) {
tmp = 2.0 * (x * y);
} else {
tmp = 2.0 * (z * t);
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: tmp
if ((y <= (-7d-54)) .or. (.not. (y <= 5.5d+68))) then
tmp = 2.0d0 * (x * y)
else
tmp = 2.0d0 * (z * t)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((y <= -7e-54) || !(y <= 5.5e+68)) {
tmp = 2.0 * (x * y);
} else {
tmp = 2.0 * (z * t);
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if (y <= -7e-54) or not (y <= 5.5e+68): tmp = 2.0 * (x * y) else: tmp = 2.0 * (z * t) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if ((y <= -7e-54) || !(y <= 5.5e+68)) tmp = Float64(2.0 * Float64(x * y)); else tmp = Float64(2.0 * Float64(z * t)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if ((y <= -7e-54) || ~((y <= 5.5e+68))) tmp = 2.0 * (x * y); else tmp = 2.0 * (z * t); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[y, -7e-54], N[Not[LessEqual[y, 5.5e+68]], $MachinePrecision]], N[(2.0 * N[(x * y), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(z * t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -7 \cdot 10^{-54} \lor \neg \left(y \leq 5.5 \cdot 10^{+68}\right):\\
\;\;\;\;2 \cdot \left(x \cdot y\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(z \cdot t\right)\\
\end{array}
\end{array}
if y < -6.99999999999999964e-54 or 5.5000000000000004e68 < y Initial program 88.3%
Taylor expanded in x around inf 46.7%
if -6.99999999999999964e-54 < y < 5.5000000000000004e68Initial program 84.2%
Taylor expanded in z around inf 34.2%
Final simplification40.7%
(FPCore (x y z t a b c i) :precision binary64 (* 2.0 (* z t)))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return 2.0 * (z * t);
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
code = 2.0d0 * (z * t)
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return 2.0 * (z * t);
}
def code(x, y, z, t, a, b, c, i): return 2.0 * (z * t)
function code(x, y, z, t, a, b, c, i) return Float64(2.0 * Float64(z * t)) end
function tmp = code(x, y, z, t, a, b, c, i) tmp = 2.0 * (z * t); end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(2.0 * N[(z * t), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
2 \cdot \left(z \cdot t\right)
\end{array}
Initial program 86.4%
Taylor expanded in z around inf 25.3%
Final simplification25.3%
(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 2023238
(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))))