
(FPCore (x y z t a b c i) :precision binary64 (* 2.0 (- (+ (* x y) (* z t)) (* (* (+ a (* b c)) c) i))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return 2.0 * (((x * y) + (z * t)) - (((a + (b * c)) * c) * i));
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
code = 2.0d0 * (((x * y) + (z * t)) - (((a + (b * c)) * c) * i))
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return 2.0 * (((x * y) + (z * t)) - (((a + (b * c)) * c) * i));
}
def code(x, y, z, t, a, b, c, i): return 2.0 * (((x * y) + (z * t)) - (((a + (b * c)) * c) * i))
function code(x, y, z, t, a, b, c, i) return Float64(2.0 * Float64(Float64(Float64(x * y) + Float64(z * t)) - Float64(Float64(Float64(a + Float64(b * c)) * c) * i))) end
function tmp = code(x, y, z, t, a, b, c, i) tmp = 2.0 * (((x * y) + (z * t)) - (((a + (b * c)) * c) * i)); end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(2.0 * N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] - N[(N[(N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision] * c), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
2 \cdot \left(\left(x \cdot y + z \cdot t\right) - \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i\right)
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 15 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a b c i) :precision binary64 (* 2.0 (- (+ (* x y) (* z t)) (* (* (+ a (* b c)) c) i))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return 2.0 * (((x * y) + (z * t)) - (((a + (b * c)) * c) * i));
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
code = 2.0d0 * (((x * y) + (z * t)) - (((a + (b * c)) * c) * i))
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return 2.0 * (((x * y) + (z * t)) - (((a + (b * c)) * c) * i));
}
def code(x, y, z, t, a, b, c, i): return 2.0 * (((x * y) + (z * t)) - (((a + (b * c)) * c) * i))
function code(x, y, z, t, a, b, c, i) return Float64(2.0 * Float64(Float64(Float64(x * y) + Float64(z * t)) - Float64(Float64(Float64(a + Float64(b * c)) * c) * i))) end
function tmp = code(x, y, z, t, a, b, c, i) tmp = 2.0 * (((x * y) + (z * t)) - (((a + (b * c)) * c) * i)); end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(2.0 * N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] - N[(N[(N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision] * c), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
2 \cdot \left(\left(x \cdot y + z \cdot t\right) - \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i\right)
\end{array}
(FPCore (x y z t a b c i)
:precision binary64
(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 (* (pow c 2.0) (fma a (/ i c) (* b i)))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = a + (b * c);
double 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 * (pow(c, 2.0) * fma(a, (i / c), (b * i)));
}
return tmp;
}
function code(x, y, z, t, a, b, c, i) t_1 = Float64(a + Float64(b * c)) tmp = 0.0 if (Float64(Float64(Float64(x * y) + Float64(z * t)) - Float64(Float64(c * t_1) * i)) <= Inf) tmp = Float64(2.0 * Float64(fma(x, y, Float64(z * t)) - Float64(t_1 * Float64(c * i)))); else tmp = Float64(-2.0 * Float64((c ^ 2.0) * fma(a, Float64(i / c), Float64(b * i)))); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] - N[(N[(c * t$95$1), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision], Infinity], N[(2.0 * N[(N[(x * y + N[(z * t), $MachinePrecision]), $MachinePrecision] - N[(t$95$1 * N[(c * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(-2.0 * N[(N[Power[c, 2.0], $MachinePrecision] * N[(a * N[(i / c), $MachinePrecision] + N[(b * i), $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({c}^{2} \cdot \mathsf{fma}\left(a, \frac{i}{c}, b \cdot i\right)\right)\\
\end{array}
\end{array}
if (-.f64 (+.f64 (*.f64 x y) (*.f64 z t)) (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i)) < +inf.0Initial program 94.7%
fma-define94.7%
associate-*l*98.7%
Simplified98.7%
if +inf.0 < (-.f64 (+.f64 (*.f64 x y) (*.f64 z t)) (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i)) Initial program 0.0%
fma-define5.9%
*-commutative5.9%
associate-*l*17.6%
+-commutative17.6%
fma-define17.6%
Simplified17.6%
Taylor expanded in c around inf 53.0%
*-commutative53.0%
distribute-lft-out53.0%
associate-*l*53.0%
*-commutative53.0%
+-commutative53.0%
associate-/l*64.7%
fma-define64.7%
*-commutative64.7%
Simplified64.7%
Final simplification96.5%
(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 (* (* i (pow c 2.0)) (- (- b) (/ a c)))))))
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 * ((i * pow(c, 2.0)) * (-b - (a / c)));
}
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(Float64(i * (c ^ 2.0)) * Float64(Float64(-b) - Float64(a / c)))); 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[(N[(i * N[Power[c, 2.0], $MachinePrecision]), $MachinePrecision] * N[((-b) - N[(a / c), $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(\left(i \cdot {c}^{2}\right) \cdot \left(\left(-b\right) - \frac{a}{c}\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.7%
fma-define94.7%
associate-*l*98.7%
Simplified98.7%
if +inf.0 < (-.f64 (+.f64 (*.f64 x y) (*.f64 z t)) (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i)) Initial program 0.0%
Taylor expanded in c around inf 0.0%
Taylor expanded in c around inf 53.0%
sub-neg53.0%
+-commutative53.0%
mul-1-neg53.0%
associate-*l/58.9%
distribute-neg-in58.9%
distribute-rgt-in58.9%
*-commutative58.9%
distribute-rgt-neg-in58.9%
*-commutative58.9%
associate-*r*58.9%
distribute-rgt-neg-in58.9%
*-commutative58.9%
Simplified58.9%
Final simplification96.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 (pow c 2.0)) (- (- b) (/ a c)))))))
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 * pow(c, 2.0)) * (-b - (a / c)));
}
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 * Math.pow(c, 2.0)) * (-b - (a / c)));
}
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 * math.pow(c, 2.0)) * (-b - (a / c))) 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(Float64(i * (c ^ 2.0)) * Float64(Float64(-b) - Float64(a / c)))); 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 ^ 2.0)) * (-b - (a / c))); 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[(N[(i * N[Power[c, 2.0], $MachinePrecision]), $MachinePrecision] * N[((-b) - N[(a / c), $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(\left(i \cdot {c}^{2}\right) \cdot \left(\left(-b\right) - \frac{a}{c}\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.7%
fma-define94.7%
associate-*l*98.7%
Simplified98.7%
fma-define98.7%
+-commutative98.7%
Applied egg-rr98.7%
if +inf.0 < (-.f64 (+.f64 (*.f64 x y) (*.f64 z t)) (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i)) Initial program 0.0%
Taylor expanded in c around inf 0.0%
Taylor expanded in c around inf 53.0%
sub-neg53.0%
+-commutative53.0%
mul-1-neg53.0%
associate-*l/58.9%
distribute-neg-in58.9%
distribute-rgt-in58.9%
*-commutative58.9%
distribute-rgt-neg-in58.9%
*-commutative58.9%
associate-*r*58.9%
distribute-rgt-neg-in58.9%
*-commutative58.9%
Simplified58.9%
Final simplification96.1%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ a (* b c)))
(t_2 (* (* c t_1) i))
(t_3 (* 2.0 (- (* x y) t_2))))
(if (<= t_2 -5e+65)
t_3
(if (<= t_2 1e+31)
(* (+ (* x y) (* z t)) 2.0)
(if (<= t_2 4e+294) t_3 (* -2.0 (* c (* t_1 i))))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = a + (b * c);
double t_2 = (c * t_1) * i;
double t_3 = 2.0 * ((x * y) - t_2);
double tmp;
if (t_2 <= -5e+65) {
tmp = t_3;
} else if (t_2 <= 1e+31) {
tmp = ((x * y) + (z * t)) * 2.0;
} else if (t_2 <= 4e+294) {
tmp = t_3;
} else {
tmp = -2.0 * (c * (t_1 * 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) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: tmp
t_1 = a + (b * c)
t_2 = (c * t_1) * i
t_3 = 2.0d0 * ((x * y) - t_2)
if (t_2 <= (-5d+65)) then
tmp = t_3
else if (t_2 <= 1d+31) then
tmp = ((x * y) + (z * t)) * 2.0d0
else if (t_2 <= 4d+294) then
tmp = t_3
else
tmp = (-2.0d0) * (c * (t_1 * 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 t_1 = a + (b * c);
double t_2 = (c * t_1) * i;
double t_3 = 2.0 * ((x * y) - t_2);
double tmp;
if (t_2 <= -5e+65) {
tmp = t_3;
} else if (t_2 <= 1e+31) {
tmp = ((x * y) + (z * t)) * 2.0;
} else if (t_2 <= 4e+294) {
tmp = t_3;
} else {
tmp = -2.0 * (c * (t_1 * i));
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = a + (b * c) t_2 = (c * t_1) * i t_3 = 2.0 * ((x * y) - t_2) tmp = 0 if t_2 <= -5e+65: tmp = t_3 elif t_2 <= 1e+31: tmp = ((x * y) + (z * t)) * 2.0 elif t_2 <= 4e+294: tmp = t_3 else: tmp = -2.0 * (c * (t_1 * i)) return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(a + Float64(b * c)) t_2 = Float64(Float64(c * t_1) * i) t_3 = Float64(2.0 * Float64(Float64(x * y) - t_2)) tmp = 0.0 if (t_2 <= -5e+65) tmp = t_3; elseif (t_2 <= 1e+31) tmp = Float64(Float64(Float64(x * y) + Float64(z * t)) * 2.0); elseif (t_2 <= 4e+294) tmp = t_3; else tmp = Float64(-2.0 * Float64(c * Float64(t_1 * i))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = a + (b * c); t_2 = (c * t_1) * i; t_3 = 2.0 * ((x * y) - t_2); tmp = 0.0; if (t_2 <= -5e+65) tmp = t_3; elseif (t_2 <= 1e+31) tmp = ((x * y) + (z * t)) * 2.0; elseif (t_2 <= 4e+294) tmp = t_3; else tmp = -2.0 * (c * (t_1 * i)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(c * t$95$1), $MachinePrecision] * i), $MachinePrecision]}, Block[{t$95$3 = N[(2.0 * N[(N[(x * y), $MachinePrecision] - t$95$2), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, -5e+65], t$95$3, If[LessEqual[t$95$2, 1e+31], N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision], If[LessEqual[t$95$2, 4e+294], t$95$3, N[(-2.0 * N[(c * N[(t$95$1 * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a + b \cdot c\\
t_2 := \left(c \cdot t\_1\right) \cdot i\\
t_3 := 2 \cdot \left(x \cdot y - t\_2\right)\\
\mathbf{if}\;t\_2 \leq -5 \cdot 10^{+65}:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;t\_2 \leq 10^{+31}:\\
\;\;\;\;\left(x \cdot y + z \cdot t\right) \cdot 2\\
\mathbf{elif}\;t\_2 \leq 4 \cdot 10^{+294}:\\
\;\;\;\;t\_3\\
\mathbf{else}:\\
\;\;\;\;-2 \cdot \left(c \cdot \left(t\_1 \cdot i\right)\right)\\
\end{array}
\end{array}
if (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < -4.99999999999999973e65 or 9.9999999999999996e30 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 4.00000000000000027e294Initial program 85.1%
Taylor expanded in x around inf 79.0%
if -4.99999999999999973e65 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 9.9999999999999996e30Initial program 99.5%
fma-define99.6%
*-commutative99.6%
associate-*l*100.0%
+-commutative100.0%
fma-define100.0%
Simplified100.0%
Taylor expanded in c around 0 94.0%
if 4.00000000000000027e294 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) Initial program 72.5%
fma-define72.5%
*-commutative72.5%
associate-*l*84.0%
+-commutative84.0%
fma-define84.0%
Simplified84.0%
Taylor expanded in i around inf 84.3%
Final simplification86.4%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ a (* b c))) (t_2 (* (* c t_1) i)))
(if (or (<= t_2 (- INFINITY)) (not (<= t_2 4e+294)))
(* -2.0 (* c (* t_1 i)))
(* (- (+ (* x y) (* z t)) t_2) 2.0))))
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)) || !(t_2 <= 4e+294)) {
tmp = -2.0 * (c * (t_1 * i));
} else {
tmp = (((x * y) + (z * t)) - t_2) * 2.0;
}
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) || !(t_2 <= 4e+294)) {
tmp = -2.0 * (c * (t_1 * i));
} else {
tmp = (((x * y) + (z * t)) - t_2) * 2.0;
}
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) or not (t_2 <= 4e+294): tmp = -2.0 * (c * (t_1 * i)) else: tmp = (((x * y) + (z * t)) - t_2) * 2.0 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)) || !(t_2 <= 4e+294)) tmp = Float64(-2.0 * Float64(c * Float64(t_1 * i))); else tmp = Float64(Float64(Float64(Float64(x * y) + Float64(z * t)) - t_2) * 2.0); 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) || ~((t_2 <= 4e+294))) tmp = -2.0 * (c * (t_1 * i)); else tmp = (((x * y) + (z * t)) - t_2) * 2.0; 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[Or[LessEqual[t$95$2, (-Infinity)], N[Not[LessEqual[t$95$2, 4e+294]], $MachinePrecision]], N[(-2.0 * N[(c * N[(t$95$1 * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] - t$95$2), $MachinePrecision] * 2.0), $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 \lor \neg \left(t\_2 \leq 4 \cdot 10^{+294}\right):\\
\;\;\;\;-2 \cdot \left(c \cdot \left(t\_1 \cdot i\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\left(x \cdot y + z \cdot t\right) - t\_2\right) \cdot 2\\
\end{array}
\end{array}
if (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < -inf.0 or 4.00000000000000027e294 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) Initial program 71.0%
fma-define72.0%
*-commutative72.0%
associate-*l*84.0%
+-commutative84.0%
fma-define84.0%
Simplified84.0%
Taylor expanded in i around inf 85.4%
if -inf.0 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 4.00000000000000027e294Initial program 99.6%
Final simplification94.0%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ a (* b c))) (t_2 (* (* c t_1) i)))
(if (or (<= t_2 -1e+278) (not (<= t_2 2e+239)))
(* -2.0 (* c (* t_1 i)))
(* 2.0 (- (+ (* x y) (* z t)) (* a (* c i)))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = a + (b * c);
double t_2 = (c * t_1) * i;
double tmp;
if ((t_2 <= -1e+278) || !(t_2 <= 2e+239)) {
tmp = -2.0 * (c * (t_1 * i));
} else {
tmp = 2.0 * (((x * y) + (z * t)) - (a * (c * i)));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = a + (b * c)
t_2 = (c * t_1) * i
if ((t_2 <= (-1d+278)) .or. (.not. (t_2 <= 2d+239))) then
tmp = (-2.0d0) * (c * (t_1 * i))
else
tmp = 2.0d0 * (((x * y) + (z * t)) - (a * (c * i)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = a + (b * c);
double t_2 = (c * t_1) * i;
double tmp;
if ((t_2 <= -1e+278) || !(t_2 <= 2e+239)) {
tmp = -2.0 * (c * (t_1 * i));
} else {
tmp = 2.0 * (((x * y) + (z * t)) - (a * (c * i)));
}
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 <= -1e+278) or not (t_2 <= 2e+239): tmp = -2.0 * (c * (t_1 * i)) else: tmp = 2.0 * (((x * y) + (z * t)) - (a * (c * i))) 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 <= -1e+278) || !(t_2 <= 2e+239)) tmp = Float64(-2.0 * Float64(c * Float64(t_1 * i))); else tmp = Float64(2.0 * Float64(Float64(Float64(x * y) + Float64(z * t)) - Float64(a * Float64(c * i)))); 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 <= -1e+278) || ~((t_2 <= 2e+239))) tmp = -2.0 * (c * (t_1 * i)); else tmp = 2.0 * (((x * y) + (z * t)) - (a * (c * i))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(c * t$95$1), $MachinePrecision] * i), $MachinePrecision]}, If[Or[LessEqual[t$95$2, -1e+278], N[Not[LessEqual[t$95$2, 2e+239]], $MachinePrecision]], N[(-2.0 * N[(c * N[(t$95$1 * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] - N[(a * N[(c * i), $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 -1 \cdot 10^{+278} \lor \neg \left(t\_2 \leq 2 \cdot 10^{+239}\right):\\
\;\;\;\;-2 \cdot \left(c \cdot \left(t\_1 \cdot i\right)\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(\left(x \cdot y + z \cdot t\right) - a \cdot \left(c \cdot i\right)\right)\\
\end{array}
\end{array}
if (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < -9.99999999999999964e277 or 1.99999999999999998e239 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) Initial program 73.1%
fma-define74.0%
*-commutative74.0%
associate-*l*83.5%
+-commutative83.5%
fma-define83.5%
Simplified83.5%
Taylor expanded in i around inf 84.1%
if -9.99999999999999964e277 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 1.99999999999999998e239Initial program 99.6%
Taylor expanded in a around inf 90.8%
Final simplification88.0%
(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 (* c (* t_1 i))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = a + (b * c);
double t_2 = (x * y) + (z * t);
double tmp;
if ((t_2 - ((c * t_1) * i)) <= ((double) INFINITY)) {
tmp = 2.0 * (t_2 - (t_1 * (c * i)));
} else {
tmp = -2.0 * (c * (t_1 * i));
}
return tmp;
}
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = a + (b * c);
double t_2 = (x * y) + (z * t);
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 * (c * (t_1 * i));
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = a + (b * c) t_2 = (x * y) + (z * t) tmp = 0 if (t_2 - ((c * t_1) * i)) <= math.inf: tmp = 2.0 * (t_2 - (t_1 * (c * i))) else: tmp = -2.0 * (c * (t_1 * i)) return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(a + Float64(b * c)) 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(c * Float64(t_1 * i))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = a + (b * c); t_2 = (x * y) + (z * t); tmp = 0.0; if ((t_2 - ((c * t_1) * i)) <= Inf) tmp = 2.0 * (t_2 - (t_1 * (c * i))); else tmp = -2.0 * (c * (t_1 * i)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(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[(c * N[(t$95$1 * i), $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(c \cdot \left(t\_1 \cdot i\right)\right)\\
\end{array}
\end{array}
if (-.f64 (+.f64 (*.f64 x y) (*.f64 z t)) (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i)) < +inf.0Initial program 94.7%
fma-define94.7%
associate-*l*98.7%
Simplified98.7%
fma-define98.7%
+-commutative98.7%
Applied egg-rr98.7%
if +inf.0 < (-.f64 (+.f64 (*.f64 x y) (*.f64 z t)) (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i)) Initial program 0.0%
fma-define5.9%
*-commutative5.9%
associate-*l*17.6%
+-commutative17.6%
fma-define17.6%
Simplified17.6%
Taylor expanded in i around inf 58.8%
Final simplification96.1%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* -2.0 (* c (* b (* c i))))))
(if (<= c -1.8e-14)
t_1
(if (<= c 9e-73)
(* x (* y 2.0))
(if (<= c 3.8e+55) (* 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 = -2.0 * (c * (b * (c * i)));
double tmp;
if (c <= -1.8e-14) {
tmp = t_1;
} else if (c <= 9e-73) {
tmp = x * (y * 2.0);
} else if (c <= 3.8e+55) {
tmp = 2.0 * (z * t);
} 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) * (c * (b * (c * i)))
if (c <= (-1.8d-14)) then
tmp = t_1
else if (c <= 9d-73) then
tmp = x * (y * 2.0d0)
else if (c <= 3.8d+55) then
tmp = 2.0d0 * (z * t)
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 * (c * (b * (c * i)));
double tmp;
if (c <= -1.8e-14) {
tmp = t_1;
} else if (c <= 9e-73) {
tmp = x * (y * 2.0);
} else if (c <= 3.8e+55) {
tmp = 2.0 * (z * t);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = -2.0 * (c * (b * (c * i))) tmp = 0 if c <= -1.8e-14: tmp = t_1 elif c <= 9e-73: tmp = x * (y * 2.0) elif c <= 3.8e+55: tmp = 2.0 * (z * t) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(-2.0 * Float64(c * Float64(b * Float64(c * i)))) tmp = 0.0 if (c <= -1.8e-14) tmp = t_1; elseif (c <= 9e-73) tmp = Float64(x * Float64(y * 2.0)); elseif (c <= 3.8e+55) tmp = Float64(2.0 * Float64(z * t)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = -2.0 * (c * (b * (c * i))); tmp = 0.0; if (c <= -1.8e-14) tmp = t_1; elseif (c <= 9e-73) tmp = x * (y * 2.0); elseif (c <= 3.8e+55) tmp = 2.0 * (z * t); 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[(c * N[(b * N[(c * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[c, -1.8e-14], t$95$1, If[LessEqual[c, 9e-73], N[(x * N[(y * 2.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[c, 3.8e+55], N[(2.0 * N[(z * t), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := -2 \cdot \left(c \cdot \left(b \cdot \left(c \cdot i\right)\right)\right)\\
\mathbf{if}\;c \leq -1.8 \cdot 10^{-14}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;c \leq 9 \cdot 10^{-73}:\\
\;\;\;\;x \cdot \left(y \cdot 2\right)\\
\mathbf{elif}\;c \leq 3.8 \cdot 10^{+55}:\\
\;\;\;\;2 \cdot \left(z \cdot t\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if c < -1.7999999999999999e-14 or 3.8e55 < c Initial program 77.7%
fma-define78.5%
*-commutative78.5%
associate-*l*88.0%
+-commutative88.0%
fma-define88.0%
Simplified88.0%
Taylor expanded in i around inf 74.5%
Taylor expanded in a around 0 56.0%
if -1.7999999999999999e-14 < c < 9e-73Initial program 98.5%
fma-define98.5%
*-commutative98.5%
associate-*l*91.6%
+-commutative91.6%
fma-define91.6%
Simplified91.6%
Taylor expanded in x around inf 52.1%
*-commutative52.1%
associate-*l*52.1%
Simplified52.1%
if 9e-73 < c < 3.8e55Initial program 94.5%
fma-define94.5%
*-commutative94.5%
associate-*l*97.3%
+-commutative97.3%
fma-define97.3%
Simplified97.3%
Taylor expanded in z around inf 44.9%
Final simplification52.8%
(FPCore (x y z t a b c i)
:precision binary64
(if (<= a -1.4e+118)
(* -2.0 (* a (* c i)))
(if (<= a -1.7e-229)
(* x (* y 2.0))
(if (<= a 4.2e+65) (* 2.0 (* z t)) (* i (* c (* a -2.0)))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (a <= -1.4e+118) {
tmp = -2.0 * (a * (c * i));
} else if (a <= -1.7e-229) {
tmp = x * (y * 2.0);
} else if (a <= 4.2e+65) {
tmp = 2.0 * (z * t);
} else {
tmp = i * (c * (a * -2.0));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: tmp
if (a <= (-1.4d+118)) then
tmp = (-2.0d0) * (a * (c * i))
else if (a <= (-1.7d-229)) then
tmp = x * (y * 2.0d0)
else if (a <= 4.2d+65) then
tmp = 2.0d0 * (z * t)
else
tmp = i * (c * (a * (-2.0d0)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (a <= -1.4e+118) {
tmp = -2.0 * (a * (c * i));
} else if (a <= -1.7e-229) {
tmp = x * (y * 2.0);
} else if (a <= 4.2e+65) {
tmp = 2.0 * (z * t);
} else {
tmp = i * (c * (a * -2.0));
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if a <= -1.4e+118: tmp = -2.0 * (a * (c * i)) elif a <= -1.7e-229: tmp = x * (y * 2.0) elif a <= 4.2e+65: tmp = 2.0 * (z * t) else: tmp = i * (c * (a * -2.0)) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (a <= -1.4e+118) tmp = Float64(-2.0 * Float64(a * Float64(c * i))); elseif (a <= -1.7e-229) tmp = Float64(x * Float64(y * 2.0)); elseif (a <= 4.2e+65) tmp = Float64(2.0 * Float64(z * t)); else tmp = Float64(i * Float64(c * Float64(a * -2.0))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if (a <= -1.4e+118) tmp = -2.0 * (a * (c * i)); elseif (a <= -1.7e-229) tmp = x * (y * 2.0); elseif (a <= 4.2e+65) tmp = 2.0 * (z * t); else tmp = i * (c * (a * -2.0)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[a, -1.4e+118], N[(-2.0 * N[(a * N[(c * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, -1.7e-229], N[(x * N[(y * 2.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 4.2e+65], N[(2.0 * N[(z * t), $MachinePrecision]), $MachinePrecision], N[(i * N[(c * N[(a * -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -1.4 \cdot 10^{+118}:\\
\;\;\;\;-2 \cdot \left(a \cdot \left(c \cdot i\right)\right)\\
\mathbf{elif}\;a \leq -1.7 \cdot 10^{-229}:\\
\;\;\;\;x \cdot \left(y \cdot 2\right)\\
\mathbf{elif}\;a \leq 4.2 \cdot 10^{+65}:\\
\;\;\;\;2 \cdot \left(z \cdot t\right)\\
\mathbf{else}:\\
\;\;\;\;i \cdot \left(c \cdot \left(a \cdot -2\right)\right)\\
\end{array}
\end{array}
if a < -1.39999999999999993e118Initial program 77.9%
fma-define77.9%
*-commutative77.9%
associate-*l*86.3%
+-commutative86.3%
fma-define86.3%
Simplified86.3%
Taylor expanded in a around inf 66.7%
if -1.39999999999999993e118 < a < -1.7e-229Initial program 90.2%
fma-define90.2%
*-commutative90.2%
associate-*l*94.5%
+-commutative94.5%
fma-define94.5%
Simplified94.5%
Taylor expanded in x around inf 41.9%
*-commutative41.9%
associate-*l*41.9%
Simplified41.9%
if -1.7e-229 < a < 4.19999999999999983e65Initial program 91.4%
fma-define92.5%
*-commutative92.5%
associate-*l*93.6%
+-commutative93.6%
fma-define93.6%
Simplified93.6%
Taylor expanded in z around inf 40.4%
if 4.19999999999999983e65 < a Initial program 87.7%
fma-define87.7%
associate-*l*89.3%
Simplified89.3%
fma-define89.3%
+-commutative89.3%
Applied egg-rr89.3%
Taylor expanded in a around inf 78.7%
Taylor expanded in z around 0 66.3%
Taylor expanded in x around 0 49.0%
associate-*r*49.0%
associate-*r*49.2%
associate-*r*49.2%
*-commutative49.2%
associate-*r*49.2%
*-commutative49.2%
*-commutative49.2%
Simplified49.2%
Final simplification46.4%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* -2.0 (* a (* c i)))))
(if (<= a -2.6e+118)
t_1
(if (<= a -1.9e-229)
(* x (* y 2.0))
(if (<= a 1.35e+65) (* 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 = -2.0 * (a * (c * i));
double tmp;
if (a <= -2.6e+118) {
tmp = t_1;
} else if (a <= -1.9e-229) {
tmp = x * (y * 2.0);
} else if (a <= 1.35e+65) {
tmp = 2.0 * (z * t);
} 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) * (a * (c * i))
if (a <= (-2.6d+118)) then
tmp = t_1
else if (a <= (-1.9d-229)) then
tmp = x * (y * 2.0d0)
else if (a <= 1.35d+65) then
tmp = 2.0d0 * (z * t)
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 * (a * (c * i));
double tmp;
if (a <= -2.6e+118) {
tmp = t_1;
} else if (a <= -1.9e-229) {
tmp = x * (y * 2.0);
} else if (a <= 1.35e+65) {
tmp = 2.0 * (z * t);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = -2.0 * (a * (c * i)) tmp = 0 if a <= -2.6e+118: tmp = t_1 elif a <= -1.9e-229: tmp = x * (y * 2.0) elif a <= 1.35e+65: tmp = 2.0 * (z * t) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(-2.0 * Float64(a * Float64(c * i))) tmp = 0.0 if (a <= -2.6e+118) tmp = t_1; elseif (a <= -1.9e-229) tmp = Float64(x * Float64(y * 2.0)); elseif (a <= 1.35e+65) tmp = Float64(2.0 * Float64(z * t)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = -2.0 * (a * (c * i)); tmp = 0.0; if (a <= -2.6e+118) tmp = t_1; elseif (a <= -1.9e-229) tmp = x * (y * 2.0); elseif (a <= 1.35e+65) tmp = 2.0 * (z * t); 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[(a * N[(c * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -2.6e+118], t$95$1, If[LessEqual[a, -1.9e-229], N[(x * N[(y * 2.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 1.35e+65], N[(2.0 * N[(z * t), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := -2 \cdot \left(a \cdot \left(c \cdot i\right)\right)\\
\mathbf{if}\;a \leq -2.6 \cdot 10^{+118}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq -1.9 \cdot 10^{-229}:\\
\;\;\;\;x \cdot \left(y \cdot 2\right)\\
\mathbf{elif}\;a \leq 1.35 \cdot 10^{+65}:\\
\;\;\;\;2 \cdot \left(z \cdot t\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if a < -2.60000000000000016e118 or 1.35000000000000009e65 < a Initial program 83.9%
fma-define83.9%
*-commutative83.9%
associate-*l*85.0%
+-commutative85.0%
fma-define85.0%
Simplified85.0%
Taylor expanded in a around inf 55.8%
if -2.60000000000000016e118 < a < -1.9000000000000001e-229Initial program 90.2%
fma-define90.2%
*-commutative90.2%
associate-*l*94.5%
+-commutative94.5%
fma-define94.5%
Simplified94.5%
Taylor expanded in x around inf 41.9%
*-commutative41.9%
associate-*l*41.9%
Simplified41.9%
if -1.9000000000000001e-229 < a < 1.35000000000000009e65Initial program 91.4%
fma-define92.5%
*-commutative92.5%
associate-*l*93.6%
+-commutative93.6%
fma-define93.6%
Simplified93.6%
Taylor expanded in z around inf 40.4%
Final simplification46.3%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= c -8.4e-15) (not (<= c 2.15e+37))) (* -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 <= -8.4e-15) || !(c <= 2.15e+37)) {
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 <= (-8.4d-15)) .or. (.not. (c <= 2.15d+37))) 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 <= -8.4e-15) || !(c <= 2.15e+37)) {
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 <= -8.4e-15) or not (c <= 2.15e+37): 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 <= -8.4e-15) || !(c <= 2.15e+37)) tmp = Float64(-2.0 * Float64(c * Float64(Float64(a + Float64(b * c)) * 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 <= -8.4e-15) || ~((c <= 2.15e+37))) 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, -8.4e-15], N[Not[LessEqual[c, 2.15e+37]], $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 -8.4 \cdot 10^{-15} \lor \neg \left(c \leq 2.15 \cdot 10^{+37}\right):\\
\;\;\;\;-2 \cdot \left(c \cdot \left(\left(a + b \cdot c\right) \cdot i\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(x \cdot y + z \cdot t\right) \cdot 2\\
\end{array}
\end{array}
if c < -8.39999999999999923e-15 or 2.1499999999999998e37 < c Initial program 77.6%
fma-define78.4%
*-commutative78.4%
associate-*l*88.4%
+-commutative88.4%
fma-define88.4%
Simplified88.4%
Taylor expanded in i around inf 74.5%
if -8.39999999999999923e-15 < c < 2.1499999999999998e37Initial program 98.1%
fma-define98.1%
*-commutative98.1%
associate-*l*92.9%
+-commutative92.9%
fma-define92.9%
Simplified92.9%
Taylor expanded in c around 0 78.0%
Final simplification76.3%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= c -1.9e+107) (not (<= c 1.12e+141))) (* -2.0 (* c (* 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.9e+107) || !(c <= 1.12e+141)) {
tmp = -2.0 * (c * (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.9d+107)) .or. (.not. (c <= 1.12d+141))) then
tmp = (-2.0d0) * (c * (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.9e+107) || !(c <= 1.12e+141)) {
tmp = -2.0 * (c * (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.9e+107) or not (c <= 1.12e+141): tmp = -2.0 * (c * (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.9e+107) || !(c <= 1.12e+141)) tmp = Float64(-2.0 * Float64(c * Float64(b * Float64(c * 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.9e+107) || ~((c <= 1.12e+141))) tmp = -2.0 * (c * (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.9e+107], N[Not[LessEqual[c, 1.12e+141]], $MachinePrecision]], N[(-2.0 * N[(c * N[(b * N[(c * i), $MachinePrecision]), $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.9 \cdot 10^{+107} \lor \neg \left(c \leq 1.12 \cdot 10^{+141}\right):\\
\;\;\;\;-2 \cdot \left(c \cdot \left(b \cdot \left(c \cdot i\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(x \cdot y + z \cdot t\right) \cdot 2\\
\end{array}
\end{array}
if c < -1.8999999999999999e107 or 1.11999999999999993e141 < c Initial program 77.1%
fma-define78.4%
*-commutative78.4%
associate-*l*86.7%
+-commutative86.7%
fma-define86.7%
Simplified86.7%
Taylor expanded in i around inf 84.7%
Taylor expanded in a around 0 68.3%
if -1.8999999999999999e107 < c < 1.11999999999999993e141Initial program 93.1%
fma-define93.1%
*-commutative93.1%
associate-*l*92.5%
+-commutative92.5%
fma-define92.5%
Simplified92.5%
Taylor expanded in c around 0 68.5%
Final simplification68.4%
(FPCore (x y z t a b c i)
:precision binary64
(if (<= c -3.8e+105)
(* -2.0 (* c (* b (* c i))))
(if (<= c 8.5e+143)
(* (+ (* x y) (* z t)) 2.0)
(* b (* (* c 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 <= -3.8e+105) {
tmp = -2.0 * (c * (b * (c * i)));
} else if (c <= 8.5e+143) {
tmp = ((x * y) + (z * t)) * 2.0;
} else {
tmp = b * ((c * 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 <= (-3.8d+105)) then
tmp = (-2.0d0) * (c * (b * (c * i)))
else if (c <= 8.5d+143) then
tmp = ((x * y) + (z * t)) * 2.0d0
else
tmp = b * ((c * 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 <= -3.8e+105) {
tmp = -2.0 * (c * (b * (c * i)));
} else if (c <= 8.5e+143) {
tmp = ((x * y) + (z * t)) * 2.0;
} else {
tmp = b * ((c * c) * (i * -2.0));
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if c <= -3.8e+105: tmp = -2.0 * (c * (b * (c * i))) elif c <= 8.5e+143: tmp = ((x * y) + (z * t)) * 2.0 else: tmp = b * ((c * c) * (i * -2.0)) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (c <= -3.8e+105) tmp = Float64(-2.0 * Float64(c * Float64(b * Float64(c * i)))); elseif (c <= 8.5e+143) tmp = Float64(Float64(Float64(x * y) + Float64(z * t)) * 2.0); else tmp = Float64(b * Float64(Float64(c * c) * Float64(i * -2.0))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if (c <= -3.8e+105) tmp = -2.0 * (c * (b * (c * i))); elseif (c <= 8.5e+143) tmp = ((x * y) + (z * t)) * 2.0; else tmp = b * ((c * c) * (i * -2.0)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[c, -3.8e+105], N[(-2.0 * N[(c * N[(b * N[(c * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[c, 8.5e+143], N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision], N[(b * N[(N[(c * c), $MachinePrecision] * N[(i * -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;c \leq -3.8 \cdot 10^{+105}:\\
\;\;\;\;-2 \cdot \left(c \cdot \left(b \cdot \left(c \cdot i\right)\right)\right)\\
\mathbf{elif}\;c \leq 8.5 \cdot 10^{+143}:\\
\;\;\;\;\left(x \cdot y + z \cdot t\right) \cdot 2\\
\mathbf{else}:\\
\;\;\;\;b \cdot \left(\left(c \cdot c\right) \cdot \left(i \cdot -2\right)\right)\\
\end{array}
\end{array}
if c < -3.8e105Initial program 81.5%
fma-define84.2%
*-commutative84.2%
associate-*l*89.1%
+-commutative89.1%
fma-define89.1%
Simplified89.1%
Taylor expanded in i around inf 87.0%
Taylor expanded in a around 0 74.0%
if -3.8e105 < c < 8.4999999999999998e143Initial program 93.1%
fma-define93.1%
*-commutative93.1%
associate-*l*92.5%
+-commutative92.5%
fma-define92.5%
Simplified92.5%
Taylor expanded in c around 0 68.5%
if 8.4999999999999998e143 < c Initial program 72.9%
fma-define72.9%
*-commutative72.9%
associate-*l*84.4%
+-commutative84.4%
fma-define84.4%
Simplified84.4%
Taylor expanded in c around inf 67.8%
*-commutative67.8%
associate-*r*67.8%
associate-*l*67.8%
Simplified67.8%
unpow267.8%
Applied egg-rr67.8%
Final simplification69.2%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= x -3.45e+31) (not (<= x 8.2e-63))) (* 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 <= -3.45e+31) || !(x <= 8.2e-63)) {
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 <= (-3.45d+31)) .or. (.not. (x <= 8.2d-63))) 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 <= -3.45e+31) || !(x <= 8.2e-63)) {
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 <= -3.45e+31) or not (x <= 8.2e-63): 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 ((x <= -3.45e+31) || !(x <= 8.2e-63)) tmp = Float64(x * Float64(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 <= -3.45e+31) || ~((x <= 8.2e-63))) 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[x, -3.45e+31], N[Not[LessEqual[x, 8.2e-63]], $MachinePrecision]], N[(x * N[(y * 2.0), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(z * t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -3.45 \cdot 10^{+31} \lor \neg \left(x \leq 8.2 \cdot 10^{-63}\right):\\
\;\;\;\;x \cdot \left(y \cdot 2\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(z \cdot t\right)\\
\end{array}
\end{array}
if x < -3.4499999999999999e31 or 8.1999999999999995e-63 < x Initial program 87.2%
fma-define87.9%
*-commutative87.9%
associate-*l*89.9%
+-commutative89.9%
fma-define89.9%
Simplified89.9%
Taylor expanded in x around inf 43.4%
*-commutative43.4%
associate-*l*43.4%
Simplified43.4%
if -3.4499999999999999e31 < x < 8.1999999999999995e-63Initial program 89.9%
fma-define89.9%
*-commutative89.9%
associate-*l*91.9%
+-commutative91.9%
fma-define91.9%
Simplified91.9%
Taylor expanded in z around inf 36.0%
Final simplification40.2%
(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 88.4%
fma-define88.8%
*-commutative88.8%
associate-*l*90.8%
+-commutative90.8%
fma-define90.8%
Simplified90.8%
Taylor expanded in z around inf 25.5%
Final simplification25.5%
(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 2024160
(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
(! :herbie-platform default (* 2 (- (+ (* x y) (* z t)) (* (+ a (* b c)) (* c i)))))
(* 2.0 (- (+ (* x y) (* z t)) (* (* (+ a (* b c)) c) i))))