
(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 13 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 (+ (* x y) (* z t))))
(if (<= (- t_2 (* (* c t_1) i)) INFINITY)
(* 2.0 (- t_2 (* t_1 (* c i))))
(* 2.0 (fma z t (fma c (* b (- (* c i))) (* x y)))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = a + (b * c);
double t_2 = (x * y) + (z * t);
double tmp;
if ((t_2 - ((c * t_1) * i)) <= ((double) INFINITY)) {
tmp = 2.0 * (t_2 - (t_1 * (c * i)));
} else {
tmp = 2.0 * fma(z, t, fma(c, (b * -(c * i)), (x * y)));
}
return tmp;
}
function code(x, y, z, t, a, b, c, i) t_1 = Float64(a + Float64(b * c)) t_2 = Float64(Float64(x * y) + Float64(z * t)) tmp = 0.0 if (Float64(t_2 - Float64(Float64(c * t_1) * i)) <= Inf) tmp = Float64(2.0 * Float64(t_2 - Float64(t_1 * Float64(c * i)))); else tmp = Float64(2.0 * fma(z, t, fma(c, Float64(b * Float64(-Float64(c * i))), Float64(x * y)))); 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[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(t$95$2 - N[(N[(c * t$95$1), $MachinePrecision] * i), $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[(z * t + N[(c * N[(b * (-N[(c * i), $MachinePrecision])), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a + b \cdot c\\
t_2 := x \cdot y + z \cdot t\\
\mathbf{if}\;t_2 - \left(c \cdot t_1\right) \cdot i \leq \infty:\\
\;\;\;\;2 \cdot \left(t_2 - t_1 \cdot \left(c \cdot i\right)\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \mathsf{fma}\left(z, t, \mathsf{fma}\left(c, b \cdot \left(-c \cdot i\right), x \cdot y\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 97.3%
associate-*l*98.6%
fma-def98.6%
Simplified98.6%
fma-def98.6%
+-commutative98.6%
Applied egg-rr98.6%
if +inf.0 < (-.f64 (+.f64 (*.f64 x y) (*.f64 z t)) (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i)) Initial program 0.0%
associate--l+0.0%
+-commutative0.0%
associate-+l-0.0%
fma-neg50.0%
neg-sub050.0%
associate-+l-50.0%
neg-sub050.0%
distribute-rgt-neg-in50.0%
*-commutative50.0%
associate-*l*57.1%
fma-def71.4%
+-commutative71.4%
fma-def71.4%
Simplified71.4%
Taylor expanded in b around inf 71.4%
mul-1-neg71.4%
associate-*r*71.4%
*-commutative71.4%
distribute-rgt-neg-in71.4%
distribute-rgt-neg-in71.4%
Simplified71.4%
Final simplification97.1%
(FPCore (x y z t a b c i) :precision binary64 (let* ((t_1 (- (+ (* x y) (* z t)) (* (* c (+ a (* b c))) i)))) (if (<= t_1 INFINITY) (* t_1 2.0) (* 2.0 (* i (* (* c c) (- b)))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = ((x * y) + (z * t)) - ((c * (a + (b * c))) * i);
double tmp;
if (t_1 <= ((double) INFINITY)) {
tmp = t_1 * 2.0;
} else {
tmp = 2.0 * (i * ((c * c) * -b));
}
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 = ((x * y) + (z * t)) - ((c * (a + (b * c))) * i);
double tmp;
if (t_1 <= Double.POSITIVE_INFINITY) {
tmp = t_1 * 2.0;
} else {
tmp = 2.0 * (i * ((c * c) * -b));
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = ((x * y) + (z * t)) - ((c * (a + (b * c))) * i) tmp = 0 if t_1 <= math.inf: tmp = t_1 * 2.0 else: tmp = 2.0 * (i * ((c * c) * -b)) return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(Float64(Float64(x * y) + Float64(z * t)) - Float64(Float64(c * Float64(a + Float64(b * c))) * i)) tmp = 0.0 if (t_1 <= Inf) tmp = Float64(t_1 * 2.0); else tmp = Float64(2.0 * Float64(i * Float64(Float64(c * c) * Float64(-b)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = ((x * y) + (z * t)) - ((c * (a + (b * c))) * i); tmp = 0.0; if (t_1 <= Inf) tmp = t_1 * 2.0; else tmp = 2.0 * (i * ((c * c) * -b)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] - N[(N[(c * N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, Infinity], N[(t$95$1 * 2.0), $MachinePrecision], N[(2.0 * N[(i * N[(N[(c * c), $MachinePrecision] * (-b)), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(x \cdot y + z \cdot t\right) - \left(c \cdot \left(a + b \cdot c\right)\right) \cdot i\\
\mathbf{if}\;t_1 \leq \infty:\\
\;\;\;\;t_1 \cdot 2\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(i \cdot \left(\left(c \cdot c\right) \cdot \left(-b\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 97.3%
if +inf.0 < (-.f64 (+.f64 (*.f64 x y) (*.f64 z t)) (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i)) Initial program 0.0%
associate-*l*7.1%
fma-def14.3%
Simplified14.3%
fma-def7.1%
+-commutative7.1%
Applied egg-rr7.1%
Taylor expanded in b around inf 57.2%
mul-1-neg57.2%
unpow257.2%
*-commutative57.2%
associate-*r*57.3%
distribute-rgt-neg-in57.3%
distribute-rgt-neg-in57.3%
Simplified57.3%
Final simplification95.1%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ a (* b c))) (t_2 (+ (* x y) (* z t))))
(if (<= (- t_2 (* (* c t_1) i)) INFINITY)
(* 2.0 (- t_2 (* t_1 (* c i))))
(* 2.0 (* i (* (* c c) (- b)))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = a + (b * c);
double t_2 = (x * y) + (z * t);
double tmp;
if ((t_2 - ((c * t_1) * i)) <= ((double) INFINITY)) {
tmp = 2.0 * (t_2 - (t_1 * (c * i)));
} else {
tmp = 2.0 * (i * ((c * c) * -b));
}
return tmp;
}
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = a + (b * c);
double t_2 = (x * y) + (z * t);
double tmp;
if ((t_2 - ((c * t_1) * i)) <= Double.POSITIVE_INFINITY) {
tmp = 2.0 * (t_2 - (t_1 * (c * i)));
} else {
tmp = 2.0 * (i * ((c * c) * -b));
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = a + (b * c) t_2 = (x * y) + (z * t) tmp = 0 if (t_2 - ((c * t_1) * i)) <= math.inf: tmp = 2.0 * (t_2 - (t_1 * (c * i))) else: tmp = 2.0 * (i * ((c * c) * -b)) return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(a + Float64(b * c)) t_2 = Float64(Float64(x * y) + Float64(z * t)) tmp = 0.0 if (Float64(t_2 - Float64(Float64(c * t_1) * i)) <= Inf) tmp = Float64(2.0 * Float64(t_2 - Float64(t_1 * Float64(c * i)))); else tmp = Float64(2.0 * Float64(i * Float64(Float64(c * c) * Float64(-b)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = a + (b * c); t_2 = (x * y) + (z * t); tmp = 0.0; if ((t_2 - ((c * t_1) * i)) <= Inf) tmp = 2.0 * (t_2 - (t_1 * (c * i))); else tmp = 2.0 * (i * ((c * c) * -b)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(t$95$2 - N[(N[(c * t$95$1), $MachinePrecision] * i), $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[(i * N[(N[(c * c), $MachinePrecision] * (-b)), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a + b \cdot c\\
t_2 := x \cdot y + z \cdot t\\
\mathbf{if}\;t_2 - \left(c \cdot t_1\right) \cdot i \leq \infty:\\
\;\;\;\;2 \cdot \left(t_2 - t_1 \cdot \left(c \cdot i\right)\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(i \cdot \left(\left(c \cdot c\right) \cdot \left(-b\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 97.3%
associate-*l*98.6%
fma-def98.6%
Simplified98.6%
fma-def98.6%
+-commutative98.6%
Applied egg-rr98.6%
if +inf.0 < (-.f64 (+.f64 (*.f64 x y) (*.f64 z t)) (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i)) Initial program 0.0%
associate-*l*7.1%
fma-def14.3%
Simplified14.3%
fma-def7.1%
+-commutative7.1%
Applied egg-rr7.1%
Taylor expanded in b around inf 57.2%
mul-1-neg57.2%
unpow257.2%
*-commutative57.2%
associate-*r*57.3%
distribute-rgt-neg-in57.3%
distribute-rgt-neg-in57.3%
Simplified57.3%
Final simplification96.3%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ (* x y) (* z t))))
(if (or (<= b -2.05e-36) (not (<= b 0.00029)))
(* 2.0 (- t_1 (* i (* b (* c c)))))
(* 2.0 (- t_1 (* i (* a c)))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = (x * y) + (z * t);
double tmp;
if ((b <= -2.05e-36) || !(b <= 0.00029)) {
tmp = 2.0 * (t_1 - (i * (b * (c * c))));
} else {
tmp = 2.0 * (t_1 - (i * (a * c)));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: t_1
real(8) :: tmp
t_1 = (x * y) + (z * t)
if ((b <= (-2.05d-36)) .or. (.not. (b <= 0.00029d0))) then
tmp = 2.0d0 * (t_1 - (i * (b * (c * c))))
else
tmp = 2.0d0 * (t_1 - (i * (a * c)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = (x * y) + (z * t);
double tmp;
if ((b <= -2.05e-36) || !(b <= 0.00029)) {
tmp = 2.0 * (t_1 - (i * (b * (c * c))));
} else {
tmp = 2.0 * (t_1 - (i * (a * c)));
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = (x * y) + (z * t) tmp = 0 if (b <= -2.05e-36) or not (b <= 0.00029): tmp = 2.0 * (t_1 - (i * (b * (c * c)))) else: tmp = 2.0 * (t_1 - (i * (a * c))) return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(Float64(x * y) + Float64(z * t)) tmp = 0.0 if ((b <= -2.05e-36) || !(b <= 0.00029)) tmp = Float64(2.0 * Float64(t_1 - Float64(i * Float64(b * Float64(c * c))))); else tmp = Float64(2.0 * Float64(t_1 - Float64(i * Float64(a * c)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = (x * y) + (z * t); tmp = 0.0; if ((b <= -2.05e-36) || ~((b <= 0.00029))) tmp = 2.0 * (t_1 - (i * (b * (c * c)))); else tmp = 2.0 * (t_1 - (i * (a * c))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[b, -2.05e-36], N[Not[LessEqual[b, 0.00029]], $MachinePrecision]], N[(2.0 * N[(t$95$1 - N[(i * N[(b * N[(c * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(t$95$1 - N[(i * N[(a * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot y + z \cdot t\\
\mathbf{if}\;b \leq -2.05 \cdot 10^{-36} \lor \neg \left(b \leq 0.00029\right):\\
\;\;\;\;2 \cdot \left(t_1 - i \cdot \left(b \cdot \left(c \cdot c\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(t_1 - i \cdot \left(a \cdot c\right)\right)\\
\end{array}
\end{array}
if b < -2.05000000000000006e-36 or 2.9e-4 < b Initial program 87.5%
Taylor expanded in a around 0 83.1%
unpow283.1%
Simplified83.1%
if -2.05000000000000006e-36 < b < 2.9e-4Initial program 96.9%
Taylor expanded in a around inf 90.7%
Final simplification86.8%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= c -1.9e+55) (not (<= c 7.1e+106))) (* 2.0 (* 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 <= -1.9e+55) || !(c <= 7.1e+106)) {
tmp = 2.0 * (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 <= (-1.9d+55)) .or. (.not. (c <= 7.1d+106))) then
tmp = 2.0d0 * (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 <= -1.9e+55) || !(c <= 7.1e+106)) {
tmp = 2.0 * (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 <= -1.9e+55) or not (c <= 7.1e+106): tmp = 2.0 * (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 <= -1.9e+55) || !(c <= 7.1e+106)) tmp = Float64(2.0 * Float64(c * Float64(Float64(a + Float64(b * c)) * Float64(-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 <= -1.9e+55) || ~((c <= 7.1e+106))) tmp = 2.0 * (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, -1.9e+55], N[Not[LessEqual[c, 7.1e+106]], $MachinePrecision]], N[(2.0 * N[(c * N[(N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision] * (-i)), $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 -1.9 \cdot 10^{+55} \lor \neg \left(c \leq 7.1 \cdot 10^{+106}\right):\\
\;\;\;\;2 \cdot \left(c \cdot \left(\left(a + b \cdot c\right) \cdot \left(-i\right)\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 < -1.9e55 or 7.1000000000000003e106 < c Initial program 81.0%
Taylor expanded in i around inf 78.1%
if -1.9e55 < c < 7.1000000000000003e106Initial program 97.8%
Taylor expanded in a around inf 90.6%
Final simplification86.3%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* (+ (* x y) (* z t)) 2.0))
(t_2 (* 2.0 (* (- c) (* i (* b c))))))
(if (<= c -1.45e+56)
t_2
(if (<= c 18000.0)
t_1
(if (<= c 2.7e+54)
(* (* a c) (* i -2.0))
(if (<= c 2.9e+91) 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 = ((x * y) + (z * t)) * 2.0;
double t_2 = 2.0 * (-c * (i * (b * c)));
double tmp;
if (c <= -1.45e+56) {
tmp = t_2;
} else if (c <= 18000.0) {
tmp = t_1;
} else if (c <= 2.7e+54) {
tmp = (a * c) * (i * -2.0);
} else if (c <= 2.9e+91) {
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 = ((x * y) + (z * t)) * 2.0d0
t_2 = 2.0d0 * (-c * (i * (b * c)))
if (c <= (-1.45d+56)) then
tmp = t_2
else if (c <= 18000.0d0) then
tmp = t_1
else if (c <= 2.7d+54) then
tmp = (a * c) * (i * (-2.0d0))
else if (c <= 2.9d+91) 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 = ((x * y) + (z * t)) * 2.0;
double t_2 = 2.0 * (-c * (i * (b * c)));
double tmp;
if (c <= -1.45e+56) {
tmp = t_2;
} else if (c <= 18000.0) {
tmp = t_1;
} else if (c <= 2.7e+54) {
tmp = (a * c) * (i * -2.0);
} else if (c <= 2.9e+91) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = ((x * y) + (z * t)) * 2.0 t_2 = 2.0 * (-c * (i * (b * c))) tmp = 0 if c <= -1.45e+56: tmp = t_2 elif c <= 18000.0: tmp = t_1 elif c <= 2.7e+54: tmp = (a * c) * (i * -2.0) elif c <= 2.9e+91: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(Float64(Float64(x * y) + Float64(z * t)) * 2.0) t_2 = Float64(2.0 * Float64(Float64(-c) * Float64(i * Float64(b * c)))) tmp = 0.0 if (c <= -1.45e+56) tmp = t_2; elseif (c <= 18000.0) tmp = t_1; elseif (c <= 2.7e+54) tmp = Float64(Float64(a * c) * Float64(i * -2.0)); elseif (c <= 2.9e+91) 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 = ((x * y) + (z * t)) * 2.0; t_2 = 2.0 * (-c * (i * (b * c))); tmp = 0.0; if (c <= -1.45e+56) tmp = t_2; elseif (c <= 18000.0) tmp = t_1; elseif (c <= 2.7e+54) tmp = (a * c) * (i * -2.0); elseif (c <= 2.9e+91) 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[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision]}, Block[{t$95$2 = N[(2.0 * N[((-c) * N[(i * N[(b * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[c, -1.45e+56], t$95$2, If[LessEqual[c, 18000.0], t$95$1, If[LessEqual[c, 2.7e+54], N[(N[(a * c), $MachinePrecision] * N[(i * -2.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[c, 2.9e+91], t$95$1, t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(x \cdot y + z \cdot t\right) \cdot 2\\
t_2 := 2 \cdot \left(\left(-c\right) \cdot \left(i \cdot \left(b \cdot c\right)\right)\right)\\
\mathbf{if}\;c \leq -1.45 \cdot 10^{+56}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;c \leq 18000:\\
\;\;\;\;t_1\\
\mathbf{elif}\;c \leq 2.7 \cdot 10^{+54}:\\
\;\;\;\;\left(a \cdot c\right) \cdot \left(i \cdot -2\right)\\
\mathbf{elif}\;c \leq 2.9 \cdot 10^{+91}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if c < -1.45000000000000004e56 or 2.90000000000000014e91 < c Initial program 81.4%
*-commutative81.4%
+-commutative81.4%
distribute-rgt-in72.5%
Applied egg-rr72.5%
Taylor expanded in b around inf 62.1%
mul-1-neg62.1%
associate-*r*66.5%
distribute-rgt-neg-in66.5%
unpow266.5%
associate-*l*69.8%
Simplified69.8%
Taylor expanded in c around 0 62.1%
mul-1-neg62.1%
unpow262.1%
*-commutative62.1%
associate-*r*62.4%
distribute-rgt-neg-in62.4%
associate-*r*66.7%
distribute-rgt-neg-in66.7%
Simplified66.7%
if -1.45000000000000004e56 < c < 18000 or 2.70000000000000011e54 < c < 2.90000000000000014e91Initial program 98.3%
Taylor expanded in c around 0 80.0%
if 18000 < c < 2.70000000000000011e54Initial program 90.0%
Taylor expanded in a around inf 61.5%
associate-*r*61.5%
neg-mul-161.5%
Simplified61.5%
Taylor expanded in c around 0 61.5%
*-commutative61.5%
*-commutative61.5%
associate-*r*70.8%
associate-*l*70.8%
Simplified70.8%
Final simplification75.0%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* (+ (* x y) (* z t)) 2.0))
(t_2 (* 2.0 (* b (* c (- (* c i)))))))
(if (<= c -2.4e+103)
t_2
(if (<= c 5000.0)
t_1
(if (<= c 8.6e+53)
(* (* a c) (* i -2.0))
(if (<= c 2.7e+119) 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 = ((x * y) + (z * t)) * 2.0;
double t_2 = 2.0 * (b * (c * -(c * i)));
double tmp;
if (c <= -2.4e+103) {
tmp = t_2;
} else if (c <= 5000.0) {
tmp = t_1;
} else if (c <= 8.6e+53) {
tmp = (a * c) * (i * -2.0);
} else if (c <= 2.7e+119) {
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 = ((x * y) + (z * t)) * 2.0d0
t_2 = 2.0d0 * (b * (c * -(c * i)))
if (c <= (-2.4d+103)) then
tmp = t_2
else if (c <= 5000.0d0) then
tmp = t_1
else if (c <= 8.6d+53) then
tmp = (a * c) * (i * (-2.0d0))
else if (c <= 2.7d+119) 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 = ((x * y) + (z * t)) * 2.0;
double t_2 = 2.0 * (b * (c * -(c * i)));
double tmp;
if (c <= -2.4e+103) {
tmp = t_2;
} else if (c <= 5000.0) {
tmp = t_1;
} else if (c <= 8.6e+53) {
tmp = (a * c) * (i * -2.0);
} else if (c <= 2.7e+119) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = ((x * y) + (z * t)) * 2.0 t_2 = 2.0 * (b * (c * -(c * i))) tmp = 0 if c <= -2.4e+103: tmp = t_2 elif c <= 5000.0: tmp = t_1 elif c <= 8.6e+53: tmp = (a * c) * (i * -2.0) elif c <= 2.7e+119: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(Float64(Float64(x * y) + Float64(z * t)) * 2.0) t_2 = Float64(2.0 * Float64(b * Float64(c * Float64(-Float64(c * i))))) tmp = 0.0 if (c <= -2.4e+103) tmp = t_2; elseif (c <= 5000.0) tmp = t_1; elseif (c <= 8.6e+53) tmp = Float64(Float64(a * c) * Float64(i * -2.0)); elseif (c <= 2.7e+119) 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 = ((x * y) + (z * t)) * 2.0; t_2 = 2.0 * (b * (c * -(c * i))); tmp = 0.0; if (c <= -2.4e+103) tmp = t_2; elseif (c <= 5000.0) tmp = t_1; elseif (c <= 8.6e+53) tmp = (a * c) * (i * -2.0); elseif (c <= 2.7e+119) 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[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision]}, Block[{t$95$2 = N[(2.0 * N[(b * N[(c * (-N[(c * i), $MachinePrecision])), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[c, -2.4e+103], t$95$2, If[LessEqual[c, 5000.0], t$95$1, If[LessEqual[c, 8.6e+53], N[(N[(a * c), $MachinePrecision] * N[(i * -2.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[c, 2.7e+119], t$95$1, t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(x \cdot y + z \cdot t\right) \cdot 2\\
t_2 := 2 \cdot \left(b \cdot \left(c \cdot \left(-c \cdot i\right)\right)\right)\\
\mathbf{if}\;c \leq -2.4 \cdot 10^{+103}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;c \leq 5000:\\
\;\;\;\;t_1\\
\mathbf{elif}\;c \leq 8.6 \cdot 10^{+53}:\\
\;\;\;\;\left(a \cdot c\right) \cdot \left(i \cdot -2\right)\\
\mathbf{elif}\;c \leq 2.7 \cdot 10^{+119}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if c < -2.3999999999999998e103 or 2.6999999999999998e119 < c Initial program 80.8%
*-commutative80.8%
+-commutative80.8%
distribute-rgt-in70.4%
Applied egg-rr70.4%
Taylor expanded in b around inf 65.8%
mul-1-neg65.8%
associate-*r*72.2%
distribute-rgt-neg-in72.2%
unpow272.2%
associate-*l*76.1%
Simplified76.1%
if -2.3999999999999998e103 < c < 5e3 or 8.5999999999999995e53 < c < 2.6999999999999998e119Initial program 97.2%
Taylor expanded in c around 0 76.9%
if 5e3 < c < 8.5999999999999995e53Initial program 90.0%
Taylor expanded in a around inf 61.5%
associate-*r*61.5%
neg-mul-161.5%
Simplified61.5%
Taylor expanded in c around 0 61.5%
*-commutative61.5%
*-commutative61.5%
associate-*r*70.8%
associate-*l*70.8%
Simplified70.8%
Final simplification76.4%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* 2.0 (* b (* c (- (* c i)))))))
(if (<= c -6.5e+102)
t_1
(if (<= c 1.5e-36)
(* (+ (* x y) (* z t)) 2.0)
(if (<= c 3.5e+119) (* 2.0 (- (* x y) (* a (* c i)))) t_1)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = 2.0 * (b * (c * -(c * i)));
double tmp;
if (c <= -6.5e+102) {
tmp = t_1;
} else if (c <= 1.5e-36) {
tmp = ((x * y) + (z * t)) * 2.0;
} else if (c <= 3.5e+119) {
tmp = 2.0 * ((x * y) - (a * (c * i)));
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: t_1
real(8) :: tmp
t_1 = 2.0d0 * (b * (c * -(c * i)))
if (c <= (-6.5d+102)) then
tmp = t_1
else if (c <= 1.5d-36) then
tmp = ((x * y) + (z * t)) * 2.0d0
else if (c <= 3.5d+119) then
tmp = 2.0d0 * ((x * y) - (a * (c * i)))
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = 2.0 * (b * (c * -(c * i)));
double tmp;
if (c <= -6.5e+102) {
tmp = t_1;
} else if (c <= 1.5e-36) {
tmp = ((x * y) + (z * t)) * 2.0;
} else if (c <= 3.5e+119) {
tmp = 2.0 * ((x * y) - (a * (c * i)));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = 2.0 * (b * (c * -(c * i))) tmp = 0 if c <= -6.5e+102: tmp = t_1 elif c <= 1.5e-36: tmp = ((x * y) + (z * t)) * 2.0 elif c <= 3.5e+119: tmp = 2.0 * ((x * y) - (a * (c * i))) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(2.0 * Float64(b * Float64(c * Float64(-Float64(c * i))))) tmp = 0.0 if (c <= -6.5e+102) tmp = t_1; elseif (c <= 1.5e-36) tmp = Float64(Float64(Float64(x * y) + Float64(z * t)) * 2.0); elseif (c <= 3.5e+119) tmp = Float64(2.0 * Float64(Float64(x * y) - Float64(a * Float64(c * i)))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = 2.0 * (b * (c * -(c * i))); tmp = 0.0; if (c <= -6.5e+102) tmp = t_1; elseif (c <= 1.5e-36) tmp = ((x * y) + (z * t)) * 2.0; elseif (c <= 3.5e+119) tmp = 2.0 * ((x * y) - (a * (c * i))); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(2.0 * N[(b * N[(c * (-N[(c * i), $MachinePrecision])), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[c, -6.5e+102], t$95$1, If[LessEqual[c, 1.5e-36], N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision], If[LessEqual[c, 3.5e+119], N[(2.0 * N[(N[(x * y), $MachinePrecision] - N[(a * N[(c * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := 2 \cdot \left(b \cdot \left(c \cdot \left(-c \cdot i\right)\right)\right)\\
\mathbf{if}\;c \leq -6.5 \cdot 10^{+102}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;c \leq 1.5 \cdot 10^{-36}:\\
\;\;\;\;\left(x \cdot y + z \cdot t\right) \cdot 2\\
\mathbf{elif}\;c \leq 3.5 \cdot 10^{+119}:\\
\;\;\;\;2 \cdot \left(x \cdot y - a \cdot \left(c \cdot i\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if c < -6.5000000000000004e102 or 3.5000000000000001e119 < c Initial program 80.8%
*-commutative80.8%
+-commutative80.8%
distribute-rgt-in70.4%
Applied egg-rr70.4%
Taylor expanded in b around inf 65.8%
mul-1-neg65.8%
associate-*r*72.2%
distribute-rgt-neg-in72.2%
unpow272.2%
associate-*l*76.1%
Simplified76.1%
if -6.5000000000000004e102 < c < 1.5000000000000001e-36Initial program 97.4%
Taylor expanded in c around 0 80.0%
if 1.5000000000000001e-36 < c < 3.5000000000000001e119Initial program 94.0%
Taylor expanded in a around inf 73.5%
Taylor expanded in z around 0 70.7%
*-commutative70.7%
associate-*l*70.4%
*-commutative70.4%
Simplified70.4%
Final simplification77.6%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= c -1.05e+45) (not (<= c 1250.0))) (* 2.0 (* c (* (+ a (* b c)) (- i)))) (* (+ (* x y) (* z t)) 2.0)))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((c <= -1.05e+45) || !(c <= 1250.0)) {
tmp = 2.0 * (c * ((a + (b * c)) * -i));
} else {
tmp = ((x * y) + (z * t)) * 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) :: tmp
if ((c <= (-1.05d+45)) .or. (.not. (c <= 1250.0d0))) then
tmp = 2.0d0 * (c * ((a + (b * c)) * -i))
else
tmp = ((x * y) + (z * t)) * 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 tmp;
if ((c <= -1.05e+45) || !(c <= 1250.0)) {
tmp = 2.0 * (c * ((a + (b * c)) * -i));
} else {
tmp = ((x * y) + (z * t)) * 2.0;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if (c <= -1.05e+45) or not (c <= 1250.0): tmp = 2.0 * (c * ((a + (b * c)) * -i)) else: tmp = ((x * y) + (z * t)) * 2.0 return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if ((c <= -1.05e+45) || !(c <= 1250.0)) tmp = Float64(2.0 * Float64(c * Float64(Float64(a + Float64(b * c)) * Float64(-i)))); else tmp = Float64(Float64(Float64(x * y) + Float64(z * t)) * 2.0); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if ((c <= -1.05e+45) || ~((c <= 1250.0))) tmp = 2.0 * (c * ((a + (b * c)) * -i)); else tmp = ((x * y) + (z * t)) * 2.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[c, -1.05e+45], N[Not[LessEqual[c, 1250.0]], $MachinePrecision]], N[(2.0 * N[(c * N[(N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision] * (-i)), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;c \leq -1.05 \cdot 10^{+45} \lor \neg \left(c \leq 1250\right):\\
\;\;\;\;2 \cdot \left(c \cdot \left(\left(a + b \cdot c\right) \cdot \left(-i\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(x \cdot y + z \cdot t\right) \cdot 2\\
\end{array}
\end{array}
if c < -1.04999999999999997e45 or 1250 < c Initial program 84.2%
Taylor expanded in i around inf 75.8%
if -1.04999999999999997e45 < c < 1250Initial program 98.1%
Taylor expanded in c around 0 81.8%
Final simplification79.2%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* 2.0 (* z t))))
(if (<= t -1.35e-32)
t_1
(if (<= t 3.5e-58)
(* 2.0 (* x y))
(if (or (<= t 60200000.0) (not (<= t 1.8e+96)))
t_1
(* (* a (* c i)) -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 tmp;
if (t <= -1.35e-32) {
tmp = t_1;
} else if (t <= 3.5e-58) {
tmp = 2.0 * (x * y);
} else if ((t <= 60200000.0) || !(t <= 1.8e+96)) {
tmp = t_1;
} else {
tmp = (a * (c * i)) * -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) :: tmp
t_1 = 2.0d0 * (z * t)
if (t <= (-1.35d-32)) then
tmp = t_1
else if (t <= 3.5d-58) then
tmp = 2.0d0 * (x * y)
else if ((t <= 60200000.0d0) .or. (.not. (t <= 1.8d+96))) then
tmp = t_1
else
tmp = (a * (c * i)) * (-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 tmp;
if (t <= -1.35e-32) {
tmp = t_1;
} else if (t <= 3.5e-58) {
tmp = 2.0 * (x * y);
} else if ((t <= 60200000.0) || !(t <= 1.8e+96)) {
tmp = t_1;
} else {
tmp = (a * (c * i)) * -2.0;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = 2.0 * (z * t) tmp = 0 if t <= -1.35e-32: tmp = t_1 elif t <= 3.5e-58: tmp = 2.0 * (x * y) elif (t <= 60200000.0) or not (t <= 1.8e+96): tmp = t_1 else: tmp = (a * (c * i)) * -2.0 return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(2.0 * Float64(z * t)) tmp = 0.0 if (t <= -1.35e-32) tmp = t_1; elseif (t <= 3.5e-58) tmp = Float64(2.0 * Float64(x * y)); elseif ((t <= 60200000.0) || !(t <= 1.8e+96)) tmp = t_1; else tmp = Float64(Float64(a * Float64(c * i)) * -2.0); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = 2.0 * (z * t); tmp = 0.0; if (t <= -1.35e-32) tmp = t_1; elseif (t <= 3.5e-58) tmp = 2.0 * (x * y); elseif ((t <= 60200000.0) || ~((t <= 1.8e+96))) tmp = t_1; else tmp = (a * (c * i)) * -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]}, If[LessEqual[t, -1.35e-32], t$95$1, If[LessEqual[t, 3.5e-58], N[(2.0 * N[(x * y), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[t, 60200000.0], N[Not[LessEqual[t, 1.8e+96]], $MachinePrecision]], t$95$1, N[(N[(a * N[(c * i), $MachinePrecision]), $MachinePrecision] * -2.0), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := 2 \cdot \left(z \cdot t\right)\\
\mathbf{if}\;t \leq -1.35 \cdot 10^{-32}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t \leq 3.5 \cdot 10^{-58}:\\
\;\;\;\;2 \cdot \left(x \cdot y\right)\\
\mathbf{elif}\;t \leq 60200000 \lor \neg \left(t \leq 1.8 \cdot 10^{+96}\right):\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;\left(a \cdot \left(c \cdot i\right)\right) \cdot -2\\
\end{array}
\end{array}
if t < -1.3499999999999999e-32 or 3.4999999999999999e-58 < t < 6.02e7 or 1.80000000000000007e96 < t Initial program 87.1%
Taylor expanded in z around inf 44.6%
if -1.3499999999999999e-32 < t < 3.4999999999999999e-58Initial program 98.1%
Taylor expanded in x around inf 50.5%
if 6.02e7 < t < 1.80000000000000007e96Initial program 91.2%
Taylor expanded in a around inf 29.6%
associate-*r*29.6%
neg-mul-129.6%
Simplified29.6%
Taylor expanded in c around 0 29.6%
associate-*r*29.6%
*-commutative29.6%
Simplified29.6%
Taylor expanded in c around 0 29.6%
associate-*r*50.7%
Simplified50.7%
Final simplification47.6%
(FPCore (x y z t a b c i)
:precision binary64
(if (or (<= t -3.3e-34)
(and (not (<= t 4e-60)) (or (<= t 2e+54) (not (<= t 1.8e+96)))))
(* 2.0 (* z t))
(* 2.0 (* x y))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((t <= -3.3e-34) || (!(t <= 4e-60) && ((t <= 2e+54) || !(t <= 1.8e+96)))) {
tmp = 2.0 * (z * t);
} else {
tmp = 2.0 * (x * y);
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: tmp
if ((t <= (-3.3d-34)) .or. (.not. (t <= 4d-60)) .and. (t <= 2d+54) .or. (.not. (t <= 1.8d+96))) then
tmp = 2.0d0 * (z * t)
else
tmp = 2.0d0 * (x * y)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((t <= -3.3e-34) || (!(t <= 4e-60) && ((t <= 2e+54) || !(t <= 1.8e+96)))) {
tmp = 2.0 * (z * t);
} else {
tmp = 2.0 * (x * y);
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if (t <= -3.3e-34) or (not (t <= 4e-60) and ((t <= 2e+54) or not (t <= 1.8e+96))): tmp = 2.0 * (z * t) else: tmp = 2.0 * (x * y) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if ((t <= -3.3e-34) || (!(t <= 4e-60) && ((t <= 2e+54) || !(t <= 1.8e+96)))) tmp = Float64(2.0 * Float64(z * t)); else tmp = Float64(2.0 * Float64(x * y)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if ((t <= -3.3e-34) || (~((t <= 4e-60)) && ((t <= 2e+54) || ~((t <= 1.8e+96))))) tmp = 2.0 * (z * t); else tmp = 2.0 * (x * y); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[t, -3.3e-34], And[N[Not[LessEqual[t, 4e-60]], $MachinePrecision], Or[LessEqual[t, 2e+54], N[Not[LessEqual[t, 1.8e+96]], $MachinePrecision]]]], N[(2.0 * N[(z * t), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(x * y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -3.3 \cdot 10^{-34} \lor \neg \left(t \leq 4 \cdot 10^{-60}\right) \land \left(t \leq 2 \cdot 10^{+54} \lor \neg \left(t \leq 1.8 \cdot 10^{+96}\right)\right):\\
\;\;\;\;2 \cdot \left(z \cdot t\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(x \cdot y\right)\\
\end{array}
\end{array}
if t < -3.29999999999999983e-34 or 3.9999999999999999e-60 < t < 2.0000000000000002e54 or 1.80000000000000007e96 < t Initial program 87.5%
Taylor expanded in z around inf 43.4%
if -3.29999999999999983e-34 < t < 3.9999999999999999e-60 or 2.0000000000000002e54 < t < 1.80000000000000007e96Initial program 97.4%
Taylor expanded in x around inf 50.1%
Final simplification46.5%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= i -2.9e+109) (not (<= i 1.18e+206))) (* (* a (* c i)) -2.0) (* (+ (* x y) (* z t)) 2.0)))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((i <= -2.9e+109) || !(i <= 1.18e+206)) {
tmp = (a * (c * i)) * -2.0;
} else {
tmp = ((x * y) + (z * t)) * 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) :: tmp
if ((i <= (-2.9d+109)) .or. (.not. (i <= 1.18d+206))) then
tmp = (a * (c * i)) * (-2.0d0)
else
tmp = ((x * y) + (z * t)) * 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 tmp;
if ((i <= -2.9e+109) || !(i <= 1.18e+206)) {
tmp = (a * (c * i)) * -2.0;
} else {
tmp = ((x * y) + (z * t)) * 2.0;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if (i <= -2.9e+109) or not (i <= 1.18e+206): tmp = (a * (c * i)) * -2.0 else: tmp = ((x * y) + (z * t)) * 2.0 return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if ((i <= -2.9e+109) || !(i <= 1.18e+206)) tmp = Float64(Float64(a * Float64(c * i)) * -2.0); else tmp = Float64(Float64(Float64(x * y) + Float64(z * t)) * 2.0); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if ((i <= -2.9e+109) || ~((i <= 1.18e+206))) tmp = (a * (c * i)) * -2.0; else tmp = ((x * y) + (z * t)) * 2.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[i, -2.9e+109], N[Not[LessEqual[i, 1.18e+206]], $MachinePrecision]], N[(N[(a * N[(c * i), $MachinePrecision]), $MachinePrecision] * -2.0), $MachinePrecision], N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;i \leq -2.9 \cdot 10^{+109} \lor \neg \left(i \leq 1.18 \cdot 10^{+206}\right):\\
\;\;\;\;\left(a \cdot \left(c \cdot i\right)\right) \cdot -2\\
\mathbf{else}:\\
\;\;\;\;\left(x \cdot y + z \cdot t\right) \cdot 2\\
\end{array}
\end{array}
if i < -2.9e109 or 1.18e206 < i Initial program 94.1%
Taylor expanded in a around inf 38.6%
associate-*r*38.6%
neg-mul-138.6%
Simplified38.6%
Taylor expanded in c around 0 38.6%
associate-*r*38.6%
*-commutative38.6%
Simplified38.6%
Taylor expanded in c around 0 38.6%
associate-*r*52.5%
Simplified52.5%
if -2.9e109 < i < 1.18e206Initial program 91.2%
Taylor expanded in c around 0 68.2%
Final simplification63.9%
(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 92.0%
Taylor expanded in z around inf 30.1%
Final simplification30.1%
(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 2023171
(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))))