
(FPCore (x y z t a b c i) :precision binary64 (* 2.0 (- (+ (* x y) (* z t)) (* (* (+ a (* b c)) c) i))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return 2.0 * (((x * y) + (z * t)) - (((a + (b * c)) * c) * i));
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
code = 2.0d0 * (((x * y) + (z * t)) - (((a + (b * c)) * c) * i))
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return 2.0 * (((x * y) + (z * t)) - (((a + (b * c)) * c) * i));
}
def code(x, y, z, t, a, b, c, i): return 2.0 * (((x * y) + (z * t)) - (((a + (b * c)) * c) * i))
function code(x, y, z, t, a, b, c, i) return Float64(2.0 * Float64(Float64(Float64(x * y) + Float64(z * t)) - Float64(Float64(Float64(a + Float64(b * c)) * c) * i))) end
function tmp = code(x, y, z, t, a, b, c, i) tmp = 2.0 * (((x * y) + (z * t)) - (((a + (b * c)) * c) * i)); end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(2.0 * N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] - N[(N[(N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision] * c), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
2 \cdot \left(\left(x \cdot y + z \cdot t\right) - \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i\right)
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 14 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a b c i) :precision binary64 (* 2.0 (- (+ (* x y) (* z t)) (* (* (+ a (* b c)) c) i))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return 2.0 * (((x * y) + (z * t)) - (((a + (b * c)) * c) * i));
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
code = 2.0d0 * (((x * y) + (z * t)) - (((a + (b * c)) * c) * i))
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return 2.0 * (((x * y) + (z * t)) - (((a + (b * c)) * c) * i));
}
def code(x, y, z, t, a, b, c, i): return 2.0 * (((x * y) + (z * t)) - (((a + (b * c)) * c) * i))
function code(x, y, z, t, a, b, c, i) return Float64(2.0 * Float64(Float64(Float64(x * y) + Float64(z * t)) - Float64(Float64(Float64(a + Float64(b * c)) * c) * i))) end
function tmp = code(x, y, z, t, a, b, c, i) tmp = 2.0 * (((x * y) + (z * t)) - (((a + (b * c)) * c) * i)); end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(2.0 * N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] - N[(N[(N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision] * c), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
2 \cdot \left(\left(x \cdot y + z \cdot t\right) - \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i\right)
\end{array}
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ a (* b c))))
(if (<= (- (+ (* x y) (* z t)) (* (* c t_1) i)) INFINITY)
(* 2.0 (- (fma x y (* z t)) (* t_1 (* c i))))
(* 2.0 (* y (- x (/ (* c (* t_1 i)) 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 tmp;
if ((((x * y) + (z * t)) - ((c * t_1) * i)) <= ((double) INFINITY)) {
tmp = 2.0 * (fma(x, y, (z * t)) - (t_1 * (c * i)));
} else {
tmp = 2.0 * (y * (x - ((c * (t_1 * i)) / y)));
}
return tmp;
}
function code(x, y, z, t, a, b, c, i) t_1 = Float64(a + Float64(b * c)) tmp = 0.0 if (Float64(Float64(Float64(x * y) + Float64(z * t)) - Float64(Float64(c * t_1) * i)) <= Inf) tmp = Float64(2.0 * Float64(fma(x, y, Float64(z * t)) - Float64(t_1 * Float64(c * i)))); else tmp = Float64(2.0 * Float64(y * Float64(x - Float64(Float64(c * Float64(t_1 * i)) / 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]}, If[LessEqual[N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] - N[(N[(c * t$95$1), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision], Infinity], N[(2.0 * N[(N[(x * y + N[(z * t), $MachinePrecision]), $MachinePrecision] - N[(t$95$1 * N[(c * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(y * N[(x - N[(N[(c * N[(t$95$1 * i), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a + b \cdot c\\
\mathbf{if}\;\left(x \cdot y + z \cdot t\right) - \left(c \cdot t\_1\right) \cdot i \leq \infty:\\
\;\;\;\;2 \cdot \left(\mathsf{fma}\left(x, y, z \cdot t\right) - t\_1 \cdot \left(c \cdot i\right)\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(y \cdot \left(x - \frac{c \cdot \left(t\_1 \cdot i\right)}{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 94.8%
fma-define94.8%
associate-*l*98.8%
Simplified98.8%
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 y around inf 45.5%
Taylor expanded in t around 0 81.8%
Final simplification98.1%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ a (* b c))) (t_2 (* (* c t_1) i)))
(if (<= t_2 (- INFINITY))
(* 2.0 (* y (- x (/ (* c (* t_1 i)) y))))
(if (<= t_2 2e+257)
(* (- (+ (* x y) (* z t)) t_2) 2.0)
(* 2.0 (- (* z t) (* b (* (* c i) (+ c (/ a 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 = (c * t_1) * i;
double tmp;
if (t_2 <= -((double) INFINITY)) {
tmp = 2.0 * (y * (x - ((c * (t_1 * i)) / y)));
} else if (t_2 <= 2e+257) {
tmp = (((x * y) + (z * t)) - t_2) * 2.0;
} else {
tmp = 2.0 * ((z * t) - (b * ((c * i) * (c + (a / 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 = (c * t_1) * i;
double tmp;
if (t_2 <= -Double.POSITIVE_INFINITY) {
tmp = 2.0 * (y * (x - ((c * (t_1 * i)) / y)));
} else if (t_2 <= 2e+257) {
tmp = (((x * y) + (z * t)) - t_2) * 2.0;
} else {
tmp = 2.0 * ((z * t) - (b * ((c * i) * (c + (a / b)))));
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = a + (b * c) t_2 = (c * t_1) * i tmp = 0 if t_2 <= -math.inf: tmp = 2.0 * (y * (x - ((c * (t_1 * i)) / y))) elif t_2 <= 2e+257: tmp = (((x * y) + (z * t)) - t_2) * 2.0 else: tmp = 2.0 * ((z * t) - (b * ((c * i) * (c + (a / b))))) return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(a + Float64(b * c)) t_2 = Float64(Float64(c * t_1) * i) tmp = 0.0 if (t_2 <= Float64(-Inf)) tmp = Float64(2.0 * Float64(y * Float64(x - Float64(Float64(c * Float64(t_1 * i)) / y)))); elseif (t_2 <= 2e+257) tmp = Float64(Float64(Float64(Float64(x * y) + Float64(z * t)) - t_2) * 2.0); else tmp = Float64(2.0 * Float64(Float64(z * t) - Float64(b * Float64(Float64(c * i) * Float64(c + Float64(a / b)))))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = a + (b * c); t_2 = (c * t_1) * i; tmp = 0.0; if (t_2 <= -Inf) tmp = 2.0 * (y * (x - ((c * (t_1 * i)) / y))); elseif (t_2 <= 2e+257) tmp = (((x * y) + (z * t)) - t_2) * 2.0; else tmp = 2.0 * ((z * t) - (b * ((c * i) * (c + (a / 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[(c * t$95$1), $MachinePrecision] * i), $MachinePrecision]}, If[LessEqual[t$95$2, (-Infinity)], N[(2.0 * N[(y * N[(x - N[(N[(c * N[(t$95$1 * i), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, 2e+257], N[(N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] - t$95$2), $MachinePrecision] * 2.0), $MachinePrecision], N[(2.0 * N[(N[(z * t), $MachinePrecision] - N[(b * N[(N[(c * i), $MachinePrecision] * N[(c + N[(a / b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a + b \cdot c\\
t_2 := \left(c \cdot t\_1\right) \cdot i\\
\mathbf{if}\;t\_2 \leq -\infty:\\
\;\;\;\;2 \cdot \left(y \cdot \left(x - \frac{c \cdot \left(t\_1 \cdot i\right)}{y}\right)\right)\\
\mathbf{elif}\;t\_2 \leq 2 \cdot 10^{+257}:\\
\;\;\;\;\left(\left(x \cdot y + z \cdot t\right) - t\_2\right) \cdot 2\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(z \cdot t - b \cdot \left(\left(c \cdot i\right) \cdot \left(c + \frac{a}{b}\right)\right)\right)\\
\end{array}
\end{array}
if (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < -inf.0Initial program 75.4%
Taylor expanded in y around inf 89.5%
Taylor expanded in t around 0 98.1%
if -inf.0 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 2.00000000000000006e257Initial program 98.7%
if 2.00000000000000006e257 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) Initial program 79.7%
fma-define81.7%
associate-*l*89.8%
Simplified89.8%
fma-define87.7%
+-commutative87.7%
Applied egg-rr87.7%
Taylor expanded in c around 0 85.4%
Taylor expanded in b around inf 83.4%
fma-define87.5%
associate-/l*87.6%
Simplified87.6%
Taylor expanded in x around 0 81.3%
associate-*r*77.5%
fma-define81.7%
associate-*r/83.6%
fma-undefine79.4%
*-commutative79.4%
associate-*r/77.5%
*-commutative77.5%
associate-/l*81.5%
distribute-lft-in87.7%
associate-*r*91.6%
associate-*r*91.6%
*-commutative91.6%
Simplified91.6%
Final simplification97.2%
(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 (* y (- x (/ (* c (* t_1 i)) 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 * (y * (x - ((c * (t_1 * i)) / y)));
}
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 * (y * (x - ((c * (t_1 * i)) / y)));
}
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 * (y * (x - ((c * (t_1 * i)) / 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 * Float64(y * Float64(x - Float64(Float64(c * Float64(t_1 * i)) / y)))); 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 * (y * (x - ((c * (t_1 * i)) / y))); 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[(y * N[(x - N[(N[(c * N[(t$95$1 * i), $MachinePrecision]), $MachinePrecision] / 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 \left(y \cdot \left(x - \frac{c \cdot \left(t\_1 \cdot i\right)}{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 94.8%
fma-define94.8%
associate-*l*98.8%
Simplified98.8%
fma-define98.8%
+-commutative98.8%
Applied egg-rr98.8%
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 y around inf 45.5%
Taylor expanded in t around 0 81.8%
Final simplification98.0%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* 2.0 (- (* z t) (* c (* (+ a (* b c)) i))))))
(if (<= c -2.4e-44)
t_1
(if (<= c -1.75e-111)
(* 2.0 (* i (- (* x (/ y i)) (* a c))))
(if (or (<= c -2.1e-132) (not (<= c 3.2e-28)))
t_1
(* (+ (* 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 t_1 = 2.0 * ((z * t) - (c * ((a + (b * c)) * i)));
double tmp;
if (c <= -2.4e-44) {
tmp = t_1;
} else if (c <= -1.75e-111) {
tmp = 2.0 * (i * ((x * (y / i)) - (a * c)));
} else if ((c <= -2.1e-132) || !(c <= 3.2e-28)) {
tmp = t_1;
} 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) :: t_1
real(8) :: tmp
t_1 = 2.0d0 * ((z * t) - (c * ((a + (b * c)) * i)))
if (c <= (-2.4d-44)) then
tmp = t_1
else if (c <= (-1.75d-111)) then
tmp = 2.0d0 * (i * ((x * (y / i)) - (a * c)))
else if ((c <= (-2.1d-132)) .or. (.not. (c <= 3.2d-28))) then
tmp = t_1
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 t_1 = 2.0 * ((z * t) - (c * ((a + (b * c)) * i)));
double tmp;
if (c <= -2.4e-44) {
tmp = t_1;
} else if (c <= -1.75e-111) {
tmp = 2.0 * (i * ((x * (y / i)) - (a * c)));
} else if ((c <= -2.1e-132) || !(c <= 3.2e-28)) {
tmp = t_1;
} else {
tmp = ((x * y) + (z * t)) * 2.0;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = 2.0 * ((z * t) - (c * ((a + (b * c)) * i))) tmp = 0 if c <= -2.4e-44: tmp = t_1 elif c <= -1.75e-111: tmp = 2.0 * (i * ((x * (y / i)) - (a * c))) elif (c <= -2.1e-132) or not (c <= 3.2e-28): tmp = t_1 else: tmp = ((x * y) + (z * t)) * 2.0 return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(2.0 * Float64(Float64(z * t) - Float64(c * Float64(Float64(a + Float64(b * c)) * i)))) tmp = 0.0 if (c <= -2.4e-44) tmp = t_1; elseif (c <= -1.75e-111) tmp = Float64(2.0 * Float64(i * Float64(Float64(x * Float64(y / i)) - Float64(a * c)))); elseif ((c <= -2.1e-132) || !(c <= 3.2e-28)) tmp = t_1; 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) t_1 = 2.0 * ((z * t) - (c * ((a + (b * c)) * i))); tmp = 0.0; if (c <= -2.4e-44) tmp = t_1; elseif (c <= -1.75e-111) tmp = 2.0 * (i * ((x * (y / i)) - (a * c))); elseif ((c <= -2.1e-132) || ~((c <= 3.2e-28))) tmp = t_1; else tmp = ((x * y) + (z * t)) * 2.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(2.0 * N[(N[(z * t), $MachinePrecision] - N[(c * N[(N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[c, -2.4e-44], t$95$1, If[LessEqual[c, -1.75e-111], N[(2.0 * N[(i * N[(N[(x * N[(y / i), $MachinePrecision]), $MachinePrecision] - N[(a * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[c, -2.1e-132], N[Not[LessEqual[c, 3.2e-28]], $MachinePrecision]], t$95$1, N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := 2 \cdot \left(z \cdot t - c \cdot \left(\left(a + b \cdot c\right) \cdot i\right)\right)\\
\mathbf{if}\;c \leq -2.4 \cdot 10^{-44}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;c \leq -1.75 \cdot 10^{-111}:\\
\;\;\;\;2 \cdot \left(i \cdot \left(x \cdot \frac{y}{i} - a \cdot c\right)\right)\\
\mathbf{elif}\;c \leq -2.1 \cdot 10^{-132} \lor \neg \left(c \leq 3.2 \cdot 10^{-28}\right):\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;\left(x \cdot y + z \cdot t\right) \cdot 2\\
\end{array}
\end{array}
if c < -2.40000000000000009e-44 or -1.75e-111 < c < -2.1000000000000001e-132 or 3.19999999999999982e-28 < c Initial program 84.4%
Taylor expanded in x around 0 81.6%
if -2.40000000000000009e-44 < c < -1.75e-111Initial program 99.8%
Taylor expanded in a around inf 98.9%
*-commutative98.9%
Simplified98.9%
Taylor expanded in z around 0 70.3%
*-commutative70.3%
associate-*r*70.6%
Simplified70.6%
Taylor expanded in i around inf 77.4%
associate-/l*84.8%
Simplified84.8%
if -2.1000000000000001e-132 < c < 3.19999999999999982e-28Initial program 97.3%
Taylor expanded in c around 0 83.5%
Final simplification82.6%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* c (* (+ a (* b c)) i))))
(if (or (<= (* x y) -1e+114) (not (<= (* x y) 500000.0)))
(* 2.0 (- (* x y) t_1))
(* 2.0 (- (* z t) t_1)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = c * ((a + (b * c)) * i);
double tmp;
if (((x * y) <= -1e+114) || !((x * y) <= 500000.0)) {
tmp = 2.0 * ((x * y) - t_1);
} else {
tmp = 2.0 * ((z * t) - t_1);
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: t_1
real(8) :: tmp
t_1 = c * ((a + (b * c)) * i)
if (((x * y) <= (-1d+114)) .or. (.not. ((x * y) <= 500000.0d0))) then
tmp = 2.0d0 * ((x * y) - t_1)
else
tmp = 2.0d0 * ((z * t) - t_1)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = c * ((a + (b * c)) * i);
double tmp;
if (((x * y) <= -1e+114) || !((x * y) <= 500000.0)) {
tmp = 2.0 * ((x * y) - t_1);
} else {
tmp = 2.0 * ((z * t) - t_1);
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = c * ((a + (b * c)) * i) tmp = 0 if ((x * y) <= -1e+114) or not ((x * y) <= 500000.0): tmp = 2.0 * ((x * y) - t_1) else: tmp = 2.0 * ((z * t) - t_1) return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(c * Float64(Float64(a + Float64(b * c)) * i)) tmp = 0.0 if ((Float64(x * y) <= -1e+114) || !(Float64(x * y) <= 500000.0)) tmp = Float64(2.0 * Float64(Float64(x * y) - t_1)); else tmp = Float64(2.0 * Float64(Float64(z * t) - t_1)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = c * ((a + (b * c)) * i); tmp = 0.0; if (((x * y) <= -1e+114) || ~(((x * y) <= 500000.0))) tmp = 2.0 * ((x * y) - t_1); else tmp = 2.0 * ((z * t) - t_1); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(c * N[(N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[N[(x * y), $MachinePrecision], -1e+114], N[Not[LessEqual[N[(x * y), $MachinePrecision], 500000.0]], $MachinePrecision]], N[(2.0 * N[(N[(x * y), $MachinePrecision] - t$95$1), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[(z * t), $MachinePrecision] - t$95$1), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := c \cdot \left(\left(a + b \cdot c\right) \cdot i\right)\\
\mathbf{if}\;x \cdot y \leq -1 \cdot 10^{+114} \lor \neg \left(x \cdot y \leq 500000\right):\\
\;\;\;\;2 \cdot \left(x \cdot y - t\_1\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(z \cdot t - t\_1\right)\\
\end{array}
\end{array}
if (*.f64 x y) < -1e114 or 5e5 < (*.f64 x y) Initial program 87.2%
Taylor expanded in z around 0 82.8%
if -1e114 < (*.f64 x y) < 5e5Initial program 93.7%
Taylor expanded in x around 0 82.9%
Final simplification82.8%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* (* x y) 2.0)))
(if (<= (* x y) -6.8e+111)
t_1
(if (<= (* x y) 2.4e-235)
(* 2.0 (* z t))
(if (<= (* x y) 2.4e+36) (* (* c (* a i)) -2.0) t_1)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = (x * y) * 2.0;
double tmp;
if ((x * y) <= -6.8e+111) {
tmp = t_1;
} else if ((x * y) <= 2.4e-235) {
tmp = 2.0 * (z * t);
} else if ((x * y) <= 2.4e+36) {
tmp = (c * (a * i)) * -2.0;
} 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 = (x * y) * 2.0d0
if ((x * y) <= (-6.8d+111)) then
tmp = t_1
else if ((x * y) <= 2.4d-235) then
tmp = 2.0d0 * (z * t)
else if ((x * y) <= 2.4d+36) then
tmp = (c * (a * i)) * (-2.0d0)
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 = (x * y) * 2.0;
double tmp;
if ((x * y) <= -6.8e+111) {
tmp = t_1;
} else if ((x * y) <= 2.4e-235) {
tmp = 2.0 * (z * t);
} else if ((x * y) <= 2.4e+36) {
tmp = (c * (a * i)) * -2.0;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = (x * y) * 2.0 tmp = 0 if (x * y) <= -6.8e+111: tmp = t_1 elif (x * y) <= 2.4e-235: tmp = 2.0 * (z * t) elif (x * y) <= 2.4e+36: tmp = (c * (a * i)) * -2.0 else: tmp = t_1 return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(Float64(x * y) * 2.0) tmp = 0.0 if (Float64(x * y) <= -6.8e+111) tmp = t_1; elseif (Float64(x * y) <= 2.4e-235) tmp = Float64(2.0 * Float64(z * t)); elseif (Float64(x * y) <= 2.4e+36) tmp = Float64(Float64(c * Float64(a * i)) * -2.0); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = (x * y) * 2.0; tmp = 0.0; if ((x * y) <= -6.8e+111) tmp = t_1; elseif ((x * y) <= 2.4e-235) tmp = 2.0 * (z * t); elseif ((x * y) <= 2.4e+36) tmp = (c * (a * i)) * -2.0; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(x * y), $MachinePrecision] * 2.0), $MachinePrecision]}, If[LessEqual[N[(x * y), $MachinePrecision], -6.8e+111], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], 2.4e-235], N[(2.0 * N[(z * t), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 2.4e+36], N[(N[(c * N[(a * i), $MachinePrecision]), $MachinePrecision] * -2.0), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(x \cdot y\right) \cdot 2\\
\mathbf{if}\;x \cdot y \leq -6.8 \cdot 10^{+111}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \cdot y \leq 2.4 \cdot 10^{-235}:\\
\;\;\;\;2 \cdot \left(z \cdot t\right)\\
\mathbf{elif}\;x \cdot y \leq 2.4 \cdot 10^{+36}:\\
\;\;\;\;\left(c \cdot \left(a \cdot i\right)\right) \cdot -2\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (*.f64 x y) < -6.8000000000000003e111 or 2.39999999999999992e36 < (*.f64 x y) Initial program 86.7%
Taylor expanded in x around inf 60.1%
if -6.8000000000000003e111 < (*.f64 x y) < 2.40000000000000011e-235Initial program 94.7%
Taylor expanded in z around inf 52.6%
if 2.40000000000000011e-235 < (*.f64 x y) < 2.39999999999999992e36Initial program 92.2%
fma-define92.2%
associate-*l*96.0%
Simplified96.0%
fma-define96.0%
+-commutative96.0%
Applied egg-rr96.0%
Taylor expanded in c around 0 86.5%
Taylor expanded in a around inf 45.2%
neg-mul-145.2%
distribute-rgt-neg-in45.2%
distribute-lft-neg-in45.2%
Simplified45.2%
Taylor expanded in a around 0 45.2%
*-commutative45.2%
associate-*r*37.7%
*-commutative37.7%
Simplified37.7%
Final simplification53.0%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* (* x y) 2.0)))
(if (<= (* x y) -1.9e+112)
t_1
(if (<= (* x y) 1.12e-234)
(* 2.0 (* z t))
(if (<= (* x y) 1e+37) (* (* c i) (* a -2.0)) t_1)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = (x * y) * 2.0;
double tmp;
if ((x * y) <= -1.9e+112) {
tmp = t_1;
} else if ((x * y) <= 1.12e-234) {
tmp = 2.0 * (z * t);
} else if ((x * y) <= 1e+37) {
tmp = (c * i) * (a * -2.0);
} 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 = (x * y) * 2.0d0
if ((x * y) <= (-1.9d+112)) then
tmp = t_1
else if ((x * y) <= 1.12d-234) then
tmp = 2.0d0 * (z * t)
else if ((x * y) <= 1d+37) then
tmp = (c * i) * (a * (-2.0d0))
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 = (x * y) * 2.0;
double tmp;
if ((x * y) <= -1.9e+112) {
tmp = t_1;
} else if ((x * y) <= 1.12e-234) {
tmp = 2.0 * (z * t);
} else if ((x * y) <= 1e+37) {
tmp = (c * i) * (a * -2.0);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = (x * y) * 2.0 tmp = 0 if (x * y) <= -1.9e+112: tmp = t_1 elif (x * y) <= 1.12e-234: tmp = 2.0 * (z * t) elif (x * y) <= 1e+37: tmp = (c * i) * (a * -2.0) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(Float64(x * y) * 2.0) tmp = 0.0 if (Float64(x * y) <= -1.9e+112) tmp = t_1; elseif (Float64(x * y) <= 1.12e-234) tmp = Float64(2.0 * Float64(z * t)); elseif (Float64(x * y) <= 1e+37) tmp = Float64(Float64(c * i) * Float64(a * -2.0)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = (x * y) * 2.0; tmp = 0.0; if ((x * y) <= -1.9e+112) tmp = t_1; elseif ((x * y) <= 1.12e-234) tmp = 2.0 * (z * t); elseif ((x * y) <= 1e+37) tmp = (c * i) * (a * -2.0); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(x * y), $MachinePrecision] * 2.0), $MachinePrecision]}, If[LessEqual[N[(x * y), $MachinePrecision], -1.9e+112], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], 1.12e-234], N[(2.0 * N[(z * t), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 1e+37], N[(N[(c * i), $MachinePrecision] * N[(a * -2.0), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(x \cdot y\right) \cdot 2\\
\mathbf{if}\;x \cdot y \leq -1.9 \cdot 10^{+112}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \cdot y \leq 1.12 \cdot 10^{-234}:\\
\;\;\;\;2 \cdot \left(z \cdot t\right)\\
\mathbf{elif}\;x \cdot y \leq 10^{+37}:\\
\;\;\;\;\left(c \cdot i\right) \cdot \left(a \cdot -2\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (*.f64 x y) < -1.90000000000000004e112 or 9.99999999999999954e36 < (*.f64 x y) Initial program 86.7%
Taylor expanded in x around inf 60.1%
if -1.90000000000000004e112 < (*.f64 x y) < 1.11999999999999998e-234Initial program 94.7%
Taylor expanded in z around inf 52.6%
if 1.11999999999999998e-234 < (*.f64 x y) < 9.99999999999999954e36Initial program 92.2%
fma-define92.2%
associate-*l*96.0%
Simplified96.0%
fma-define96.0%
+-commutative96.0%
Applied egg-rr96.0%
Taylor expanded in c around 0 86.5%
Taylor expanded in a around inf 45.2%
neg-mul-145.2%
distribute-rgt-neg-in45.2%
distribute-lft-neg-in45.2%
Simplified45.2%
Taylor expanded in a around 0 45.2%
associate-*r*45.2%
*-commutative45.2%
Simplified45.2%
Final simplification54.5%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= (* x y) -1.15e+71) (not (<= (* x y) 1.75e+38))) (* (+ (* x y) (* z t)) 2.0) (* 2.0 (- (* z t) (* c (* a i))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (((x * y) <= -1.15e+71) || !((x * y) <= 1.75e+38)) {
tmp = ((x * y) + (z * t)) * 2.0;
} else {
tmp = 2.0 * ((z * t) - (c * (a * i)));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: tmp
if (((x * y) <= (-1.15d+71)) .or. (.not. ((x * y) <= 1.75d+38))) then
tmp = ((x * y) + (z * t)) * 2.0d0
else
tmp = 2.0d0 * ((z * t) - (c * (a * i)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (((x * y) <= -1.15e+71) || !((x * y) <= 1.75e+38)) {
tmp = ((x * y) + (z * t)) * 2.0;
} else {
tmp = 2.0 * ((z * t) - (c * (a * i)));
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if ((x * y) <= -1.15e+71) or not ((x * y) <= 1.75e+38): tmp = ((x * y) + (z * t)) * 2.0 else: tmp = 2.0 * ((z * t) - (c * (a * i))) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if ((Float64(x * y) <= -1.15e+71) || !(Float64(x * y) <= 1.75e+38)) tmp = Float64(Float64(Float64(x * y) + Float64(z * t)) * 2.0); else tmp = Float64(2.0 * Float64(Float64(z * t) - Float64(c * Float64(a * i)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if (((x * y) <= -1.15e+71) || ~(((x * y) <= 1.75e+38))) tmp = ((x * y) + (z * t)) * 2.0; else tmp = 2.0 * ((z * t) - (c * (a * i))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[N[(x * y), $MachinePrecision], -1.15e+71], N[Not[LessEqual[N[(x * y), $MachinePrecision], 1.75e+38]], $MachinePrecision]], N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision], N[(2.0 * N[(N[(z * t), $MachinePrecision] - N[(c * N[(a * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \cdot y \leq -1.15 \cdot 10^{+71} \lor \neg \left(x \cdot y \leq 1.75 \cdot 10^{+38}\right):\\
\;\;\;\;\left(x \cdot y + z \cdot t\right) \cdot 2\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(z \cdot t - c \cdot \left(a \cdot i\right)\right)\\
\end{array}
\end{array}
if (*.f64 x y) < -1.1500000000000001e71 or 1.75000000000000001e38 < (*.f64 x y) Initial program 87.1%
Taylor expanded in c around 0 70.0%
if -1.1500000000000001e71 < (*.f64 x y) < 1.75000000000000001e38Initial program 94.1%
Taylor expanded in a around inf 72.2%
*-commutative72.2%
Simplified72.2%
Taylor expanded in x around 0 70.3%
*-commutative70.3%
associate-*r*62.5%
Simplified62.5%
Final simplification66.1%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= c -3.4e+34) (not (<= c 6e-18))) (* 2.0 (- (* x y) (* 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 <= -3.4e+34) || !(c <= 6e-18)) {
tmp = 2.0 * ((x * y) - (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 <= (-3.4d+34)) .or. (.not. (c <= 6d-18))) then
tmp = 2.0d0 * ((x * y) - (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 <= -3.4e+34) || !(c <= 6e-18)) {
tmp = 2.0 * ((x * y) - (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 <= -3.4e+34) or not (c <= 6e-18): tmp = 2.0 * ((x * y) - (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 <= -3.4e+34) || !(c <= 6e-18)) tmp = Float64(2.0 * Float64(Float64(x * y) - Float64(c * Float64(Float64(a + Float64(b * c)) * i)))); else tmp = Float64(2.0 * Float64(Float64(Float64(x * y) + Float64(z * t)) - Float64(i * Float64(a * c)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if ((c <= -3.4e+34) || ~((c <= 6e-18))) tmp = 2.0 * ((x * y) - (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, -3.4e+34], N[Not[LessEqual[c, 6e-18]], $MachinePrecision]], N[(2.0 * N[(N[(x * y), $MachinePrecision] - N[(c * N[(N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] - N[(i * N[(a * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;c \leq -3.4 \cdot 10^{+34} \lor \neg \left(c \leq 6 \cdot 10^{-18}\right):\\
\;\;\;\;2 \cdot \left(x \cdot y - c \cdot \left(\left(a + b \cdot c\right) \cdot i\right)\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(\left(x \cdot y + z \cdot t\right) - i \cdot \left(a \cdot c\right)\right)\\
\end{array}
\end{array}
if c < -3.3999999999999999e34 or 5.99999999999999966e-18 < c Initial program 81.9%
Taylor expanded in z around 0 85.4%
if -3.3999999999999999e34 < c < 5.99999999999999966e-18Initial program 97.8%
Taylor expanded in a around inf 93.1%
*-commutative93.1%
Simplified93.1%
Final simplification89.7%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= c -2.5e+35) (not (<= c 3.8e-16))) (* (* c (* (+ a (* b 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 ((c <= -2.5e+35) || !(c <= 3.8e-16)) {
tmp = (c * ((a + (b * 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 ((c <= (-2.5d+35)) .or. (.not. (c <= 3.8d-16))) then
tmp = (c * ((a + (b * 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 ((c <= -2.5e+35) || !(c <= 3.8e-16)) {
tmp = (c * ((a + (b * 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 (c <= -2.5e+35) or not (c <= 3.8e-16): tmp = (c * ((a + (b * 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 ((c <= -2.5e+35) || !(c <= 3.8e-16)) tmp = Float64(Float64(c * Float64(Float64(a + Float64(b * c)) * i)) * Float64(-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 ((c <= -2.5e+35) || ~((c <= 3.8e-16))) tmp = (c * ((a + (b * 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[c, -2.5e+35], N[Not[LessEqual[c, 3.8e-16]], $MachinePrecision]], N[(N[(c * N[(N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision] * 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}\;c \leq -2.5 \cdot 10^{+35} \lor \neg \left(c \leq 3.8 \cdot 10^{-16}\right):\\
\;\;\;\;\left(c \cdot \left(\left(a + b \cdot c\right) \cdot i\right)\right) \cdot \left(-2\right)\\
\mathbf{else}:\\
\;\;\;\;\left(x \cdot y + z \cdot t\right) \cdot 2\\
\end{array}
\end{array}
if c < -2.50000000000000011e35 or 3.80000000000000012e-16 < c Initial program 81.9%
Taylor expanded in i around inf 75.3%
if -2.50000000000000011e35 < c < 3.80000000000000012e-16Initial program 97.8%
Taylor expanded in c around 0 78.9%
Final simplification77.3%
(FPCore (x y z t a b c i)
:precision binary64
(if (<= c -2.25e+36)
(* 2.0 (* (* b c) (* i (- (/ a (- b)) c))))
(if (<= c 1.15e-15)
(* (+ (* x y) (* z t)) 2.0)
(* (* c (* (+ a (* b c)) i)) (- 2.0)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (c <= -2.25e+36) {
tmp = 2.0 * ((b * c) * (i * ((a / -b) - c)));
} else if (c <= 1.15e-15) {
tmp = ((x * y) + (z * t)) * 2.0;
} else {
tmp = (c * ((a + (b * 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) :: tmp
if (c <= (-2.25d+36)) then
tmp = 2.0d0 * ((b * c) * (i * ((a / -b) - c)))
else if (c <= 1.15d-15) then
tmp = ((x * y) + (z * t)) * 2.0d0
else
tmp = (c * ((a + (b * 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 tmp;
if (c <= -2.25e+36) {
tmp = 2.0 * ((b * c) * (i * ((a / -b) - c)));
} else if (c <= 1.15e-15) {
tmp = ((x * y) + (z * t)) * 2.0;
} else {
tmp = (c * ((a + (b * c)) * i)) * -2.0;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if c <= -2.25e+36: tmp = 2.0 * ((b * c) * (i * ((a / -b) - c))) elif c <= 1.15e-15: tmp = ((x * y) + (z * t)) * 2.0 else: tmp = (c * ((a + (b * c)) * i)) * -2.0 return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (c <= -2.25e+36) tmp = Float64(2.0 * Float64(Float64(b * c) * Float64(i * Float64(Float64(a / Float64(-b)) - c)))); elseif (c <= 1.15e-15) tmp = Float64(Float64(Float64(x * y) + Float64(z * t)) * 2.0); else tmp = Float64(Float64(c * Float64(Float64(a + Float64(b * c)) * i)) * Float64(-2.0)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if (c <= -2.25e+36) tmp = 2.0 * ((b * c) * (i * ((a / -b) - c))); elseif (c <= 1.15e-15) tmp = ((x * y) + (z * t)) * 2.0; else tmp = (c * ((a + (b * c)) * i)) * -2.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[c, -2.25e+36], N[(2.0 * N[(N[(b * c), $MachinePrecision] * N[(i * N[(N[(a / (-b)), $MachinePrecision] - c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[c, 1.15e-15], N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision], N[(N[(c * N[(N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision] * (-2.0)), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;c \leq -2.25 \cdot 10^{+36}:\\
\;\;\;\;2 \cdot \left(\left(b \cdot c\right) \cdot \left(i \cdot \left(\frac{a}{-b} - c\right)\right)\right)\\
\mathbf{elif}\;c \leq 1.15 \cdot 10^{-15}:\\
\;\;\;\;\left(x \cdot y + z \cdot t\right) \cdot 2\\
\mathbf{else}:\\
\;\;\;\;\left(c \cdot \left(\left(a + b \cdot c\right) \cdot i\right)\right) \cdot \left(-2\right)\\
\end{array}
\end{array}
if c < -2.24999999999999998e36Initial program 89.5%
fma-define91.6%
associate-*l*95.9%
Simplified95.9%
fma-define93.7%
+-commutative93.7%
Applied egg-rr93.7%
Taylor expanded in c around 0 89.3%
Taylor expanded in b around inf 83.1%
fma-define87.3%
associate-/l*85.2%
Simplified85.2%
Taylor expanded in i around inf 78.0%
mul-1-neg78.0%
associate-*r*79.4%
distribute-lft-in70.9%
*-commutative70.9%
associate-/l*66.7%
*-commutative66.7%
associate-*r/66.7%
fma-undefine71.0%
*-commutative71.0%
distribute-rgt-neg-in71.0%
fma-undefine66.7%
*-commutative66.7%
associate-*r/66.7%
*-commutative66.7%
associate-/l*70.9%
distribute-lft-in79.4%
Simplified79.4%
if -2.24999999999999998e36 < c < 1.14999999999999995e-15Initial program 97.8%
Taylor expanded in c around 0 78.9%
if 1.14999999999999995e-15 < c Initial program 76.6%
Taylor expanded in i around inf 72.5%
Final simplification77.3%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= (* x y) -1.35e+111) (not (<= (* x y) 8200000000.0))) (* (* x y) 2.0) (* 2.0 (* z t))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (((x * y) <= -1.35e+111) || !((x * y) <= 8200000000.0)) {
tmp = (x * y) * 2.0;
} else {
tmp = 2.0 * (z * t);
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: tmp
if (((x * y) <= (-1.35d+111)) .or. (.not. ((x * y) <= 8200000000.0d0))) then
tmp = (x * y) * 2.0d0
else
tmp = 2.0d0 * (z * t)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (((x * y) <= -1.35e+111) || !((x * y) <= 8200000000.0)) {
tmp = (x * y) * 2.0;
} else {
tmp = 2.0 * (z * t);
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if ((x * y) <= -1.35e+111) or not ((x * y) <= 8200000000.0): tmp = (x * y) * 2.0 else: tmp = 2.0 * (z * t) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if ((Float64(x * y) <= -1.35e+111) || !(Float64(x * y) <= 8200000000.0)) tmp = Float64(Float64(x * y) * 2.0); else tmp = Float64(2.0 * Float64(z * t)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if (((x * y) <= -1.35e+111) || ~(((x * y) <= 8200000000.0))) tmp = (x * y) * 2.0; else tmp = 2.0 * (z * t); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[N[(x * y), $MachinePrecision], -1.35e+111], N[Not[LessEqual[N[(x * y), $MachinePrecision], 8200000000.0]], $MachinePrecision]], N[(N[(x * y), $MachinePrecision] * 2.0), $MachinePrecision], N[(2.0 * N[(z * t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \cdot y \leq -1.35 \cdot 10^{+111} \lor \neg \left(x \cdot y \leq 8200000000\right):\\
\;\;\;\;\left(x \cdot y\right) \cdot 2\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(z \cdot t\right)\\
\end{array}
\end{array}
if (*.f64 x y) < -1.3499999999999999e111 or 8.2e9 < (*.f64 x y) Initial program 87.2%
Taylor expanded in x around inf 58.1%
if -1.3499999999999999e111 < (*.f64 x y) < 8.2e9Initial program 93.7%
Taylor expanded in z around inf 43.2%
Final simplification49.9%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= i -6e+169) (not (<= i 1.65e+121))) (* (* c i) (* a -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 <= -6e+169) || !(i <= 1.65e+121)) {
tmp = (c * i) * (a * -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 <= (-6d+169)) .or. (.not. (i <= 1.65d+121))) then
tmp = (c * i) * (a * (-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 <= -6e+169) || !(i <= 1.65e+121)) {
tmp = (c * i) * (a * -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 <= -6e+169) or not (i <= 1.65e+121): tmp = (c * i) * (a * -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 <= -6e+169) || !(i <= 1.65e+121)) tmp = Float64(Float64(c * i) * Float64(a * -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 <= -6e+169) || ~((i <= 1.65e+121))) tmp = (c * i) * (a * -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, -6e+169], N[Not[LessEqual[i, 1.65e+121]], $MachinePrecision]], N[(N[(c * i), $MachinePrecision] * N[(a * -2.0), $MachinePrecision]), $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 -6 \cdot 10^{+169} \lor \neg \left(i \leq 1.65 \cdot 10^{+121}\right):\\
\;\;\;\;\left(c \cdot i\right) \cdot \left(a \cdot -2\right)\\
\mathbf{else}:\\
\;\;\;\;\left(x \cdot y + z \cdot t\right) \cdot 2\\
\end{array}
\end{array}
if i < -5.9999999999999999e169 or 1.6499999999999999e121 < i Initial program 92.5%
fma-define92.5%
associate-*l*93.9%
Simplified93.9%
fma-define93.9%
+-commutative93.9%
Applied egg-rr93.9%
Taylor expanded in c around 0 66.7%
Taylor expanded in a around inf 51.5%
neg-mul-151.5%
distribute-rgt-neg-in51.5%
distribute-lft-neg-in51.5%
Simplified51.5%
Taylor expanded in a around 0 51.5%
associate-*r*51.5%
*-commutative51.5%
Simplified51.5%
if -5.9999999999999999e169 < i < 1.6499999999999999e121Initial program 90.1%
Taylor expanded in c around 0 67.2%
Final simplification63.1%
(FPCore (x y z t a b c i) :precision binary64 (* 2.0 (* z t)))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return 2.0 * (z * t);
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
code = 2.0d0 * (z * t)
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return 2.0 * (z * t);
}
def code(x, y, z, t, a, b, c, i): return 2.0 * (z * t)
function code(x, y, z, t, a, b, c, i) return Float64(2.0 * Float64(z * t)) end
function tmp = code(x, y, z, t, a, b, c, i) tmp = 2.0 * (z * t); end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(2.0 * N[(z * t), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
2 \cdot \left(z \cdot t\right)
\end{array}
Initial program 90.7%
Taylor expanded in z around inf 30.8%
Final simplification30.8%
(FPCore (x y z t a b c i) :precision binary64 (* 2.0 (- (+ (* x y) (* z t)) (* (+ a (* b c)) (* c i)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return 2.0 * (((x * y) + (z * t)) - ((a + (b * c)) * (c * i)));
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
code = 2.0d0 * (((x * y) + (z * t)) - ((a + (b * c)) * (c * i)))
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return 2.0 * (((x * y) + (z * t)) - ((a + (b * c)) * (c * i)));
}
def code(x, y, z, t, a, b, c, i): return 2.0 * (((x * y) + (z * t)) - ((a + (b * c)) * (c * i)))
function code(x, y, z, t, a, b, c, i) return Float64(2.0 * Float64(Float64(Float64(x * y) + Float64(z * t)) - Float64(Float64(a + Float64(b * c)) * Float64(c * i)))) end
function tmp = code(x, y, z, t, a, b, c, i) tmp = 2.0 * (((x * y) + (z * t)) - ((a + (b * c)) * (c * i))); end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(2.0 * N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] - N[(N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision] * N[(c * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
2 \cdot \left(\left(x \cdot y + z \cdot t\right) - \left(a + b \cdot c\right) \cdot \left(c \cdot i\right)\right)
\end{array}
herbie shell --seed 2024076
(FPCore (x y z t a b c i)
:name "Diagrams.ThreeD.Shapes:frustum from diagrams-lib-1.3.0.3, A"
:precision binary64
:alt
(* 2.0 (- (+ (* x y) (* z t)) (* (+ a (* b c)) (* c i))))
(* 2.0 (- (+ (* x y) (* z t)) (* (* (+ a (* b c)) c) i))))