
(FPCore (x y z t a b c i) :precision binary64 (* 2.0 (- (+ (* x y) (* z t)) (* (* (+ a (* b c)) c) i))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return 2.0 * (((x * y) + (z * t)) - (((a + (b * c)) * c) * i));
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
code = 2.0d0 * (((x * y) + (z * t)) - (((a + (b * c)) * c) * i))
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return 2.0 * (((x * y) + (z * t)) - (((a + (b * c)) * c) * i));
}
def code(x, y, z, t, a, b, c, i): return 2.0 * (((x * y) + (z * t)) - (((a + (b * c)) * c) * i))
function code(x, y, z, t, a, b, c, i) return Float64(2.0 * Float64(Float64(Float64(x * y) + Float64(z * t)) - Float64(Float64(Float64(a + Float64(b * c)) * c) * i))) end
function tmp = code(x, y, z, t, a, b, c, i) tmp = 2.0 * (((x * y) + (z * t)) - (((a + (b * c)) * c) * i)); end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(2.0 * N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] - N[(N[(N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision] * c), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
2 \cdot \left(\left(x \cdot y + z \cdot t\right) - \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i\right)
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 13 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a b c i) :precision binary64 (* 2.0 (- (+ (* x y) (* z t)) (* (* (+ a (* b c)) c) i))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return 2.0 * (((x * y) + (z * t)) - (((a + (b * c)) * c) * i));
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
code = 2.0d0 * (((x * y) + (z * t)) - (((a + (b * c)) * c) * i))
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return 2.0 * (((x * y) + (z * t)) - (((a + (b * c)) * c) * i));
}
def code(x, y, z, t, a, b, c, i): return 2.0 * (((x * y) + (z * t)) - (((a + (b * c)) * c) * i))
function code(x, y, z, t, a, b, c, i) return Float64(2.0 * Float64(Float64(Float64(x * y) + Float64(z * t)) - Float64(Float64(Float64(a + Float64(b * c)) * c) * i))) end
function tmp = code(x, y, z, t, a, b, c, i) tmp = 2.0 * (((x * y) + (z * t)) - (((a + (b * c)) * c) * i)); end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(2.0 * N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] - N[(N[(N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision] * c), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
2 \cdot \left(\left(x \cdot y + z \cdot t\right) - \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i\right)
\end{array}
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ a (* b c))) (t_2 (+ (* x y) (* z t))))
(if (<= (- t_2 (* (* c t_1) i)) INFINITY)
(* 2.0 (- t_2 (* t_1 (* c i))))
(* 2.0 (- (* z t) (* c (* b (* 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 = (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 * ((z * t) - (c * (b * (c * 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 * ((z * t) - (c * (b * (c * 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 * ((z * t) - (c * (b * (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(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(z * t) - Float64(c * Float64(b * 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 = (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 * ((z * t) - (c * (b * (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[(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[(z * t), $MachinePrecision] - N[(c * N[(b * N[(c * i), $MachinePrecision]), $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(z \cdot t - c \cdot \left(b \cdot \left(c \cdot i\right)\right)\right)\\
\end{array}
\end{array}
if (-.f64 (+.f64 (*.f64 x y) (*.f64 z t)) (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i)) < +inf.0Initial program 94.7%
fma-define94.7%
associate-*l*99.5%
Simplified99.5%
fma-define99.5%
+-commutative99.5%
Applied egg-rr99.5%
if +inf.0 < (-.f64 (+.f64 (*.f64 x y) (*.f64 z t)) (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i)) Initial program 0.0%
associate--l+0.0%
*-commutative0.0%
associate--l+0.0%
associate--l+0.0%
*-commutative0.0%
associate--l+0.0%
fma-define0.0%
*-commutative0.0%
associate-*l*11.1%
+-commutative11.1%
fma-define11.1%
Simplified11.1%
Taylor expanded in x around 0 33.3%
Taylor expanded in a around 0 66.7%
Final simplification98.4%
(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 -1e+303)
(* 2.0 (- (* z t) (* c (* c (+ (* b i) (/ (* a i) c))))))
(if (<= t_2 -5e+152)
t_3
(if (<= t_2 5e+74)
(* 2.0 (- (+ (* x y) (* z t)) (* i (* c (* b c)))))
(if (<= t_2 1e+308) t_3 (* 2.0 (- (* z t) (* 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 <= -1e+303) {
tmp = 2.0 * ((z * t) - (c * (c * ((b * i) + ((a * i) / c)))));
} else if (t_2 <= -5e+152) {
tmp = t_3;
} else if (t_2 <= 5e+74) {
tmp = 2.0 * (((x * y) + (z * t)) - (i * (c * (b * c))));
} else if (t_2 <= 1e+308) {
tmp = t_3;
} else {
tmp = 2.0 * ((z * t) - (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 <= (-1d+303)) then
tmp = 2.0d0 * ((z * t) - (c * (c * ((b * i) + ((a * i) / c)))))
else if (t_2 <= (-5d+152)) then
tmp = t_3
else if (t_2 <= 5d+74) then
tmp = 2.0d0 * (((x * y) + (z * t)) - (i * (c * (b * c))))
else if (t_2 <= 1d+308) then
tmp = t_3
else
tmp = 2.0d0 * ((z * t) - (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 <= -1e+303) {
tmp = 2.0 * ((z * t) - (c * (c * ((b * i) + ((a * i) / c)))));
} else if (t_2 <= -5e+152) {
tmp = t_3;
} else if (t_2 <= 5e+74) {
tmp = 2.0 * (((x * y) + (z * t)) - (i * (c * (b * c))));
} else if (t_2 <= 1e+308) {
tmp = t_3;
} else {
tmp = 2.0 * ((z * t) - (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 <= -1e+303: tmp = 2.0 * ((z * t) - (c * (c * ((b * i) + ((a * i) / c))))) elif t_2 <= -5e+152: tmp = t_3 elif t_2 <= 5e+74: tmp = 2.0 * (((x * y) + (z * t)) - (i * (c * (b * c)))) elif t_2 <= 1e+308: tmp = t_3 else: tmp = 2.0 * ((z * t) - (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 <= -1e+303) tmp = Float64(2.0 * Float64(Float64(z * t) - Float64(c * Float64(c * Float64(Float64(b * i) + Float64(Float64(a * i) / c)))))); elseif (t_2 <= -5e+152) tmp = t_3; elseif (t_2 <= 5e+74) tmp = Float64(2.0 * Float64(Float64(Float64(x * y) + Float64(z * t)) - Float64(i * Float64(c * Float64(b * c))))); elseif (t_2 <= 1e+308) tmp = t_3; else tmp = Float64(2.0 * Float64(Float64(z * t) - 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 <= -1e+303) tmp = 2.0 * ((z * t) - (c * (c * ((b * i) + ((a * i) / c))))); elseif (t_2 <= -5e+152) tmp = t_3; elseif (t_2 <= 5e+74) tmp = 2.0 * (((x * y) + (z * t)) - (i * (c * (b * c)))); elseif (t_2 <= 1e+308) tmp = t_3; else tmp = 2.0 * ((z * t) - (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, -1e+303], N[(2.0 * N[(N[(z * t), $MachinePrecision] - N[(c * N[(c * N[(N[(b * i), $MachinePrecision] + N[(N[(a * i), $MachinePrecision] / c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, -5e+152], t$95$3, If[LessEqual[t$95$2, 5e+74], N[(2.0 * N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] - N[(i * N[(c * N[(b * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, 1e+308], t$95$3, N[(2.0 * N[(N[(z * t), $MachinePrecision] - N[(c * N[(t$95$1 * 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\\
t_3 := 2 \cdot \left(x \cdot y - t\_2\right)\\
\mathbf{if}\;t\_2 \leq -1 \cdot 10^{+303}:\\
\;\;\;\;2 \cdot \left(z \cdot t - c \cdot \left(c \cdot \left(b \cdot i + \frac{a \cdot i}{c}\right)\right)\right)\\
\mathbf{elif}\;t\_2 \leq -5 \cdot 10^{+152}:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;t\_2 \leq 5 \cdot 10^{+74}:\\
\;\;\;\;2 \cdot \left(\left(x \cdot y + z \cdot t\right) - i \cdot \left(c \cdot \left(b \cdot c\right)\right)\right)\\
\mathbf{elif}\;t\_2 \leq 10^{+308}:\\
\;\;\;\;t\_3\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(z \cdot t - c \cdot \left(t\_1 \cdot i\right)\right)\\
\end{array}
\end{array}
if (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < -1e303Initial program 76.1%
associate--l+76.1%
*-commutative76.1%
associate--l+76.1%
associate--l+76.1%
*-commutative76.1%
associate--l+76.1%
fma-define76.1%
*-commutative76.1%
associate-*l*86.5%
+-commutative86.5%
fma-define86.5%
Simplified86.5%
Taylor expanded in x around 0 88.8%
Taylor expanded in c around inf 90.8%
if -1e303 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < -5e152 or 4.99999999999999963e74 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 1e308Initial program 99.7%
Taylor expanded in x around inf 89.7%
if -5e152 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 4.99999999999999963e74Initial program 97.5%
Taylor expanded in a around 0 90.9%
*-commutative90.9%
Simplified90.9%
if 1e308 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) Initial program 81.9%
associate--l+81.9%
*-commutative81.9%
associate--l+81.9%
associate--l+81.9%
*-commutative81.9%
associate--l+81.9%
fma-define81.9%
*-commutative81.9%
associate-*l*95.8%
+-commutative95.8%
fma-define95.8%
Simplified95.8%
Taylor expanded in x around 0 95.8%
Final simplification91.6%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ a (* b c)))
(t_2 (* 2.0 (- (* z t) (* c (* t_1 i)))))
(t_3 (* (* c t_1) i))
(t_4 (* 2.0 (- (* x y) t_3))))
(if (<= t_3 -1e+303)
t_2
(if (<= t_3 -5e+152)
t_4
(if (<= t_3 5e+74)
(* 2.0 (- (+ (* x y) (* z t)) (* i (* c (* b c)))))
(if (<= t_3 1e+308) t_4 t_2))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = a + (b * c);
double t_2 = 2.0 * ((z * t) - (c * (t_1 * i)));
double t_3 = (c * t_1) * i;
double t_4 = 2.0 * ((x * y) - t_3);
double tmp;
if (t_3 <= -1e+303) {
tmp = t_2;
} else if (t_3 <= -5e+152) {
tmp = t_4;
} else if (t_3 <= 5e+74) {
tmp = 2.0 * (((x * y) + (z * t)) - (i * (c * (b * c))));
} else if (t_3 <= 1e+308) {
tmp = t_4;
} else {
tmp = t_2;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: t_4
real(8) :: tmp
t_1 = a + (b * c)
t_2 = 2.0d0 * ((z * t) - (c * (t_1 * i)))
t_3 = (c * t_1) * i
t_4 = 2.0d0 * ((x * y) - t_3)
if (t_3 <= (-1d+303)) then
tmp = t_2
else if (t_3 <= (-5d+152)) then
tmp = t_4
else if (t_3 <= 5d+74) then
tmp = 2.0d0 * (((x * y) + (z * t)) - (i * (c * (b * c))))
else if (t_3 <= 1d+308) then
tmp = t_4
else
tmp = t_2
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = a + (b * c);
double t_2 = 2.0 * ((z * t) - (c * (t_1 * i)));
double t_3 = (c * t_1) * i;
double t_4 = 2.0 * ((x * y) - t_3);
double tmp;
if (t_3 <= -1e+303) {
tmp = t_2;
} else if (t_3 <= -5e+152) {
tmp = t_4;
} else if (t_3 <= 5e+74) {
tmp = 2.0 * (((x * y) + (z * t)) - (i * (c * (b * c))));
} else if (t_3 <= 1e+308) {
tmp = t_4;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = a + (b * c) t_2 = 2.0 * ((z * t) - (c * (t_1 * i))) t_3 = (c * t_1) * i t_4 = 2.0 * ((x * y) - t_3) tmp = 0 if t_3 <= -1e+303: tmp = t_2 elif t_3 <= -5e+152: tmp = t_4 elif t_3 <= 5e+74: tmp = 2.0 * (((x * y) + (z * t)) - (i * (c * (b * c)))) elif t_3 <= 1e+308: tmp = t_4 else: tmp = t_2 return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(a + Float64(b * c)) t_2 = Float64(2.0 * Float64(Float64(z * t) - Float64(c * Float64(t_1 * i)))) t_3 = Float64(Float64(c * t_1) * i) t_4 = Float64(2.0 * Float64(Float64(x * y) - t_3)) tmp = 0.0 if (t_3 <= -1e+303) tmp = t_2; elseif (t_3 <= -5e+152) tmp = t_4; elseif (t_3 <= 5e+74) tmp = Float64(2.0 * Float64(Float64(Float64(x * y) + Float64(z * t)) - Float64(i * Float64(c * Float64(b * c))))); elseif (t_3 <= 1e+308) tmp = t_4; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = a + (b * c); t_2 = 2.0 * ((z * t) - (c * (t_1 * i))); t_3 = (c * t_1) * i; t_4 = 2.0 * ((x * y) - t_3); tmp = 0.0; if (t_3 <= -1e+303) tmp = t_2; elseif (t_3 <= -5e+152) tmp = t_4; elseif (t_3 <= 5e+74) tmp = 2.0 * (((x * y) + (z * t)) - (i * (c * (b * c)))); elseif (t_3 <= 1e+308) tmp = t_4; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(2.0 * N[(N[(z * t), $MachinePrecision] - N[(c * N[(t$95$1 * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(c * t$95$1), $MachinePrecision] * i), $MachinePrecision]}, Block[{t$95$4 = N[(2.0 * N[(N[(x * y), $MachinePrecision] - t$95$3), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$3, -1e+303], t$95$2, If[LessEqual[t$95$3, -5e+152], t$95$4, If[LessEqual[t$95$3, 5e+74], N[(2.0 * N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] - N[(i * N[(c * N[(b * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$3, 1e+308], t$95$4, t$95$2]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a + b \cdot c\\
t_2 := 2 \cdot \left(z \cdot t - c \cdot \left(t\_1 \cdot i\right)\right)\\
t_3 := \left(c \cdot t\_1\right) \cdot i\\
t_4 := 2 \cdot \left(x \cdot y - t\_3\right)\\
\mathbf{if}\;t\_3 \leq -1 \cdot 10^{+303}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_3 \leq -5 \cdot 10^{+152}:\\
\;\;\;\;t\_4\\
\mathbf{elif}\;t\_3 \leq 5 \cdot 10^{+74}:\\
\;\;\;\;2 \cdot \left(\left(x \cdot y + z \cdot t\right) - i \cdot \left(c \cdot \left(b \cdot c\right)\right)\right)\\
\mathbf{elif}\;t\_3 \leq 10^{+308}:\\
\;\;\;\;t\_4\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < -1e303 or 1e308 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) Initial program 79.1%
associate--l+79.1%
*-commutative79.1%
associate--l+79.1%
associate--l+79.1%
*-commutative79.1%
associate--l+79.1%
fma-define79.1%
*-commutative79.1%
associate-*l*91.4%
+-commutative91.4%
fma-define91.4%
Simplified91.4%
Taylor expanded in x around 0 92.4%
if -1e303 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < -5e152 or 4.99999999999999963e74 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 1e308Initial program 99.7%
Taylor expanded in x around inf 89.7%
if -5e152 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 4.99999999999999963e74Initial program 97.5%
Taylor expanded in a around 0 90.9%
*-commutative90.9%
Simplified90.9%
Final simplification91.2%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ a (* b c)))
(t_2 (* 2.0 (- (* z t) (* c (* t_1 i)))))
(t_3 (* (* c t_1) i))
(t_4 (* 2.0 (- (* x y) t_3))))
(if (<= t_3 -1e+303)
t_2
(if (<= t_3 -2e-82)
t_4
(if (<= t_3 5e-142)
(* (+ (* x y) (* z t)) 2.0)
(if (<= t_3 1e+308) t_4 t_2))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = a + (b * c);
double t_2 = 2.0 * ((z * t) - (c * (t_1 * i)));
double t_3 = (c * t_1) * i;
double t_4 = 2.0 * ((x * y) - t_3);
double tmp;
if (t_3 <= -1e+303) {
tmp = t_2;
} else if (t_3 <= -2e-82) {
tmp = t_4;
} else if (t_3 <= 5e-142) {
tmp = ((x * y) + (z * t)) * 2.0;
} else if (t_3 <= 1e+308) {
tmp = t_4;
} else {
tmp = t_2;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: t_4
real(8) :: tmp
t_1 = a + (b * c)
t_2 = 2.0d0 * ((z * t) - (c * (t_1 * i)))
t_3 = (c * t_1) * i
t_4 = 2.0d0 * ((x * y) - t_3)
if (t_3 <= (-1d+303)) then
tmp = t_2
else if (t_3 <= (-2d-82)) then
tmp = t_4
else if (t_3 <= 5d-142) then
tmp = ((x * y) + (z * t)) * 2.0d0
else if (t_3 <= 1d+308) then
tmp = t_4
else
tmp = t_2
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = a + (b * c);
double t_2 = 2.0 * ((z * t) - (c * (t_1 * i)));
double t_3 = (c * t_1) * i;
double t_4 = 2.0 * ((x * y) - t_3);
double tmp;
if (t_3 <= -1e+303) {
tmp = t_2;
} else if (t_3 <= -2e-82) {
tmp = t_4;
} else if (t_3 <= 5e-142) {
tmp = ((x * y) + (z * t)) * 2.0;
} else if (t_3 <= 1e+308) {
tmp = t_4;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = a + (b * c) t_2 = 2.0 * ((z * t) - (c * (t_1 * i))) t_3 = (c * t_1) * i t_4 = 2.0 * ((x * y) - t_3) tmp = 0 if t_3 <= -1e+303: tmp = t_2 elif t_3 <= -2e-82: tmp = t_4 elif t_3 <= 5e-142: tmp = ((x * y) + (z * t)) * 2.0 elif t_3 <= 1e+308: tmp = t_4 else: tmp = t_2 return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(a + Float64(b * c)) t_2 = Float64(2.0 * Float64(Float64(z * t) - Float64(c * Float64(t_1 * i)))) t_3 = Float64(Float64(c * t_1) * i) t_4 = Float64(2.0 * Float64(Float64(x * y) - t_3)) tmp = 0.0 if (t_3 <= -1e+303) tmp = t_2; elseif (t_3 <= -2e-82) tmp = t_4; elseif (t_3 <= 5e-142) tmp = Float64(Float64(Float64(x * y) + Float64(z * t)) * 2.0); elseif (t_3 <= 1e+308) tmp = t_4; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = a + (b * c); t_2 = 2.0 * ((z * t) - (c * (t_1 * i))); t_3 = (c * t_1) * i; t_4 = 2.0 * ((x * y) - t_3); tmp = 0.0; if (t_3 <= -1e+303) tmp = t_2; elseif (t_3 <= -2e-82) tmp = t_4; elseif (t_3 <= 5e-142) tmp = ((x * y) + (z * t)) * 2.0; elseif (t_3 <= 1e+308) tmp = t_4; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(2.0 * N[(N[(z * t), $MachinePrecision] - N[(c * N[(t$95$1 * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(c * t$95$1), $MachinePrecision] * i), $MachinePrecision]}, Block[{t$95$4 = N[(2.0 * N[(N[(x * y), $MachinePrecision] - t$95$3), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$3, -1e+303], t$95$2, If[LessEqual[t$95$3, -2e-82], t$95$4, If[LessEqual[t$95$3, 5e-142], N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision], If[LessEqual[t$95$3, 1e+308], t$95$4, t$95$2]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a + b \cdot c\\
t_2 := 2 \cdot \left(z \cdot t - c \cdot \left(t\_1 \cdot i\right)\right)\\
t_3 := \left(c \cdot t\_1\right) \cdot i\\
t_4 := 2 \cdot \left(x \cdot y - t\_3\right)\\
\mathbf{if}\;t\_3 \leq -1 \cdot 10^{+303}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_3 \leq -2 \cdot 10^{-82}:\\
\;\;\;\;t\_4\\
\mathbf{elif}\;t\_3 \leq 5 \cdot 10^{-142}:\\
\;\;\;\;\left(x \cdot y + z \cdot t\right) \cdot 2\\
\mathbf{elif}\;t\_3 \leq 10^{+308}:\\
\;\;\;\;t\_4\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < -1e303 or 1e308 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) Initial program 79.1%
associate--l+79.1%
*-commutative79.1%
associate--l+79.1%
associate--l+79.1%
*-commutative79.1%
associate--l+79.1%
fma-define79.1%
*-commutative79.1%
associate-*l*91.4%
+-commutative91.4%
fma-define91.4%
Simplified91.4%
Taylor expanded in x around 0 92.4%
if -1e303 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < -2e-82 or 5.0000000000000002e-142 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 1e308Initial program 98.8%
Taylor expanded in x around inf 82.5%
if -2e-82 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 5.0000000000000002e-142Initial program 97.3%
associate--l+97.3%
*-commutative97.3%
associate--l+97.3%
associate--l+97.3%
*-commutative97.3%
associate--l+97.3%
fma-define97.3%
*-commutative97.3%
associate-*l*100.0%
+-commutative100.0%
fma-define100.0%
Simplified100.0%
Taylor expanded in c around 0 96.0%
Final simplification89.6%
(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 (- (* z t) (* c (* c (+ (* b i) (/ (* a i) c))))))
(if (<= t_2 1e+308)
(* (- (+ (* x y) (* z t)) t_2) 2.0)
(* 2.0 (- (* z t) (* 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 tmp;
if (t_2 <= -((double) INFINITY)) {
tmp = 2.0 * ((z * t) - (c * (c * ((b * i) + ((a * i) / c)))));
} else if (t_2 <= 1e+308) {
tmp = (((x * y) + (z * t)) - t_2) * 2.0;
} else {
tmp = 2.0 * ((z * t) - (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 = (c * t_1) * i;
double tmp;
if (t_2 <= -Double.POSITIVE_INFINITY) {
tmp = 2.0 * ((z * t) - (c * (c * ((b * i) + ((a * i) / c)))));
} else if (t_2 <= 1e+308) {
tmp = (((x * y) + (z * t)) - t_2) * 2.0;
} else {
tmp = 2.0 * ((z * t) - (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 tmp = 0 if t_2 <= -math.inf: tmp = 2.0 * ((z * t) - (c * (c * ((b * i) + ((a * i) / c))))) elif t_2 <= 1e+308: tmp = (((x * y) + (z * t)) - t_2) * 2.0 else: tmp = 2.0 * ((z * t) - (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) tmp = 0.0 if (t_2 <= Float64(-Inf)) tmp = Float64(2.0 * Float64(Float64(z * t) - Float64(c * Float64(c * Float64(Float64(b * i) + Float64(Float64(a * i) / c)))))); elseif (t_2 <= 1e+308) tmp = Float64(Float64(Float64(Float64(x * y) + Float64(z * t)) - t_2) * 2.0); else tmp = Float64(2.0 * Float64(Float64(z * t) - 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; tmp = 0.0; if (t_2 <= -Inf) tmp = 2.0 * ((z * t) - (c * (c * ((b * i) + ((a * i) / c))))); elseif (t_2 <= 1e+308) tmp = (((x * y) + (z * t)) - t_2) * 2.0; else tmp = 2.0 * ((z * t) - (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]}, If[LessEqual[t$95$2, (-Infinity)], N[(2.0 * N[(N[(z * t), $MachinePrecision] - N[(c * N[(c * N[(N[(b * i), $MachinePrecision] + N[(N[(a * i), $MachinePrecision] / c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, 1e+308], 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[(c * N[(t$95$1 * 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 -\infty:\\
\;\;\;\;2 \cdot \left(z \cdot t - c \cdot \left(c \cdot \left(b \cdot i + \frac{a \cdot i}{c}\right)\right)\right)\\
\mathbf{elif}\;t\_2 \leq 10^{+308}:\\
\;\;\;\;\left(\left(x \cdot y + z \cdot t\right) - t\_2\right) \cdot 2\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(z \cdot t - c \cdot \left(t\_1 \cdot i\right)\right)\\
\end{array}
\end{array}
if (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < -inf.0Initial program 75.5%
associate--l+75.5%
*-commutative75.5%
associate--l+75.5%
associate--l+75.5%
*-commutative75.5%
associate--l+75.5%
fma-define75.5%
*-commutative75.5%
associate-*l*86.2%
+-commutative86.2%
fma-define86.2%
Simplified86.2%
Taylor expanded in x around 0 88.5%
Taylor expanded in c around inf 90.6%
if -inf.0 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 1e308Initial program 98.2%
if 1e308 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) Initial program 81.9%
associate--l+81.9%
*-commutative81.9%
associate--l+81.9%
associate--l+81.9%
*-commutative81.9%
associate--l+81.9%
fma-define81.9%
*-commutative81.9%
associate-*l*95.8%
+-commutative95.8%
fma-define95.8%
Simplified95.8%
Taylor expanded in x around 0 95.8%
Final simplification96.5%
(FPCore (x y z t a b c i)
:precision binary64
(if (<= c -1.9e+137)
(* 2.0 (- (* z t) (* c (* b (* c i)))))
(if (or (<= c -2.7e-53) (not (<= c 5.5e-25)))
(* (* 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 <= -1.9e+137) {
tmp = 2.0 * ((z * t) - (c * (b * (c * i))));
} else if ((c <= -2.7e-53) || !(c <= 5.5e-25)) {
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 <= (-1.9d+137)) then
tmp = 2.0d0 * ((z * t) - (c * (b * (c * i))))
else if ((c <= (-2.7d-53)) .or. (.not. (c <= 5.5d-25))) 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 <= -1.9e+137) {
tmp = 2.0 * ((z * t) - (c * (b * (c * i))));
} else if ((c <= -2.7e-53) || !(c <= 5.5e-25)) {
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 <= -1.9e+137: tmp = 2.0 * ((z * t) - (c * (b * (c * i)))) elif (c <= -2.7e-53) or not (c <= 5.5e-25): 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 <= -1.9e+137) tmp = Float64(2.0 * Float64(Float64(z * t) - Float64(c * Float64(b * Float64(c * i))))); elseif ((c <= -2.7e-53) || !(c <= 5.5e-25)) tmp = Float64(Float64(c * Float64(Float64(a + Float64(b * c)) * i)) * -2.0); else tmp = Float64(Float64(Float64(x * y) + Float64(z * t)) * 2.0); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if (c <= -1.9e+137) tmp = 2.0 * ((z * t) - (c * (b * (c * i)))); elseif ((c <= -2.7e-53) || ~((c <= 5.5e-25))) 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[LessEqual[c, -1.9e+137], N[(2.0 * N[(N[(z * t), $MachinePrecision] - N[(c * N[(b * N[(c * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[c, -2.7e-53], N[Not[LessEqual[c, 5.5e-25]], $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 -1.9 \cdot 10^{+137}:\\
\;\;\;\;2 \cdot \left(z \cdot t - c \cdot \left(b \cdot \left(c \cdot i\right)\right)\right)\\
\mathbf{elif}\;c \leq -2.7 \cdot 10^{-53} \lor \neg \left(c \leq 5.5 \cdot 10^{-25}\right):\\
\;\;\;\;\left(c \cdot \left(\left(a + b \cdot c\right) \cdot i\right)\right) \cdot -2\\
\mathbf{else}:\\
\;\;\;\;\left(x \cdot y + z \cdot t\right) \cdot 2\\
\end{array}
\end{array}
if c < -1.89999999999999981e137Initial program 74.8%
associate--l+74.8%
*-commutative74.8%
associate--l+74.8%
associate--l+74.8%
*-commutative74.8%
associate--l+74.8%
fma-define74.8%
*-commutative74.8%
associate-*l*89.6%
+-commutative89.6%
fma-define89.6%
Simplified89.6%
Taylor expanded in x around 0 89.7%
Taylor expanded in a around 0 87.0%
if -1.89999999999999981e137 < c < -2.6999999999999999e-53 or 5.50000000000000004e-25 < c Initial program 91.4%
associate--l+91.4%
*-commutative91.4%
associate--l+91.4%
associate--l+91.4%
*-commutative91.4%
associate--l+91.4%
fma-define91.4%
*-commutative91.4%
associate-*l*96.1%
+-commutative96.1%
fma-define96.1%
Simplified96.1%
Taylor expanded in i around inf 77.9%
if -2.6999999999999999e-53 < c < 5.50000000000000004e-25Initial program 96.6%
associate--l+96.6%
*-commutative96.6%
associate--l+96.6%
associate--l+96.6%
*-commutative96.6%
associate--l+96.6%
fma-define96.6%
*-commutative96.6%
associate-*l*87.6%
+-commutative87.6%
fma-define87.6%
Simplified87.6%
Taylor expanded in c around 0 81.1%
Final simplification80.7%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* x (* y 2.0))) (t_2 (* 2.0 (* z t))))
(if (<= t -3.8e+61)
t_2
(if (<= t -1.75e-302)
t_1
(if (<= t 225000.0)
(* -2.0 (* a (* c i)))
(if (<= t 7.3e+99) t_1 t_2))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = x * (y * 2.0);
double t_2 = 2.0 * (z * t);
double tmp;
if (t <= -3.8e+61) {
tmp = t_2;
} else if (t <= -1.75e-302) {
tmp = t_1;
} else if (t <= 225000.0) {
tmp = -2.0 * (a * (c * i));
} else if (t <= 7.3e+99) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = x * (y * 2.0d0)
t_2 = 2.0d0 * (z * t)
if (t <= (-3.8d+61)) then
tmp = t_2
else if (t <= (-1.75d-302)) then
tmp = t_1
else if (t <= 225000.0d0) then
tmp = (-2.0d0) * (a * (c * i))
else if (t <= 7.3d+99) then
tmp = t_1
else
tmp = t_2
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = x * (y * 2.0);
double t_2 = 2.0 * (z * t);
double tmp;
if (t <= -3.8e+61) {
tmp = t_2;
} else if (t <= -1.75e-302) {
tmp = t_1;
} else if (t <= 225000.0) {
tmp = -2.0 * (a * (c * i));
} else if (t <= 7.3e+99) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = x * (y * 2.0) t_2 = 2.0 * (z * t) tmp = 0 if t <= -3.8e+61: tmp = t_2 elif t <= -1.75e-302: tmp = t_1 elif t <= 225000.0: tmp = -2.0 * (a * (c * i)) elif t <= 7.3e+99: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(x * Float64(y * 2.0)) t_2 = Float64(2.0 * Float64(z * t)) tmp = 0.0 if (t <= -3.8e+61) tmp = t_2; elseif (t <= -1.75e-302) tmp = t_1; elseif (t <= 225000.0) tmp = Float64(-2.0 * Float64(a * Float64(c * i))); elseif (t <= 7.3e+99) tmp = t_1; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = x * (y * 2.0); t_2 = 2.0 * (z * t); tmp = 0.0; if (t <= -3.8e+61) tmp = t_2; elseif (t <= -1.75e-302) tmp = t_1; elseif (t <= 225000.0) tmp = -2.0 * (a * (c * i)); elseif (t <= 7.3e+99) tmp = t_1; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(x * N[(y * 2.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(2.0 * N[(z * t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -3.8e+61], t$95$2, If[LessEqual[t, -1.75e-302], t$95$1, If[LessEqual[t, 225000.0], N[(-2.0 * N[(a * N[(c * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 7.3e+99], t$95$1, t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \left(y \cdot 2\right)\\
t_2 := 2 \cdot \left(z \cdot t\right)\\
\mathbf{if}\;t \leq -3.8 \cdot 10^{+61}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t \leq -1.75 \cdot 10^{-302}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 225000:\\
\;\;\;\;-2 \cdot \left(a \cdot \left(c \cdot i\right)\right)\\
\mathbf{elif}\;t \leq 7.3 \cdot 10^{+99}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if t < -3.79999999999999995e61 or 7.2999999999999998e99 < t Initial program 89.7%
associate--l+89.7%
*-commutative89.7%
associate--l+89.7%
associate--l+89.7%
*-commutative89.7%
associate--l+89.7%
fma-define89.7%
*-commutative89.7%
associate-*l*89.7%
+-commutative89.7%
fma-define89.7%
Simplified89.7%
Taylor expanded in z around inf 52.3%
if -3.79999999999999995e61 < t < -1.7500000000000001e-302 or 225000 < t < 7.2999999999999998e99Initial program 91.6%
associate--l+91.6%
*-commutative91.6%
associate--l+91.6%
associate--l+91.6%
*-commutative91.6%
associate--l+91.6%
fma-define91.6%
*-commutative91.6%
associate-*l*90.3%
+-commutative90.3%
fma-define90.3%
Simplified90.3%
Taylor expanded in x around inf 40.2%
*-commutative40.2%
associate-*l*40.2%
Simplified40.2%
if -1.7500000000000001e-302 < t < 225000Initial program 92.8%
associate--l+92.8%
*-commutative92.8%
associate--l+92.8%
associate--l+92.8%
*-commutative92.8%
associate--l+92.8%
fma-define92.8%
*-commutative92.8%
associate-*l*94.0%
+-commutative94.0%
fma-define94.0%
Simplified94.0%
Taylor expanded in a around inf 37.1%
Final simplification43.4%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= c -3e-52) (not (<= c 6e-27))) (* 2.0 (- (* z t) (* 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 <= -3e-52) || !(c <= 6e-27)) {
tmp = 2.0 * ((z * t) - (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 <= (-3d-52)) .or. (.not. (c <= 6d-27))) then
tmp = 2.0d0 * ((z * t) - (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 <= -3e-52) || !(c <= 6e-27)) {
tmp = 2.0 * ((z * t) - (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 <= -3e-52) or not (c <= 6e-27): tmp = 2.0 * ((z * t) - (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 <= -3e-52) || !(c <= 6e-27)) tmp = Float64(2.0 * Float64(Float64(z * t) - 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 <= -3e-52) || ~((c <= 6e-27))) tmp = 2.0 * ((z * t) - (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, -3e-52], N[Not[LessEqual[c, 6e-27]], $MachinePrecision]], N[(2.0 * N[(N[(z * t), $MachinePrecision] - N[(c * N[(N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;c \leq -3 \cdot 10^{-52} \lor \neg \left(c \leq 6 \cdot 10^{-27}\right):\\
\;\;\;\;2 \cdot \left(z \cdot t - 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 < -3e-52 or 6.0000000000000002e-27 < c Initial program 86.9%
associate--l+86.9%
*-commutative86.9%
associate--l+86.9%
associate--l+86.9%
*-commutative86.9%
associate--l+86.9%
fma-define86.9%
*-commutative86.9%
associate-*l*94.3%
+-commutative94.3%
fma-define94.3%
Simplified94.3%
Taylor expanded in x around 0 86.0%
if -3e-52 < c < 6.0000000000000002e-27Initial program 96.6%
associate--l+96.6%
*-commutative96.6%
associate--l+96.6%
associate--l+96.6%
*-commutative96.6%
associate--l+96.6%
fma-define96.6%
*-commutative96.6%
associate-*l*87.6%
+-commutative87.6%
fma-define87.6%
Simplified87.6%
Taylor expanded in c around 0 81.1%
Final simplification83.8%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* (* c (* b (* c i))) -2.0)))
(if (<= c -4.6e+104)
t_1
(if (<= c -7.6e-19)
(* c (* a (* i -2.0)))
(if (<= c 2e+54) (* (+ (* x y) (* z t)) 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 = (c * (b * (c * i))) * -2.0;
double tmp;
if (c <= -4.6e+104) {
tmp = t_1;
} else if (c <= -7.6e-19) {
tmp = c * (a * (i * -2.0));
} else if (c <= 2e+54) {
tmp = ((x * y) + (z * t)) * 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 = (c * (b * (c * i))) * (-2.0d0)
if (c <= (-4.6d+104)) then
tmp = t_1
else if (c <= (-7.6d-19)) then
tmp = c * (a * (i * (-2.0d0)))
else if (c <= 2d+54) then
tmp = ((x * y) + (z * t)) * 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 = (c * (b * (c * i))) * -2.0;
double tmp;
if (c <= -4.6e+104) {
tmp = t_1;
} else if (c <= -7.6e-19) {
tmp = c * (a * (i * -2.0));
} else if (c <= 2e+54) {
tmp = ((x * y) + (z * t)) * 2.0;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = (c * (b * (c * i))) * -2.0 tmp = 0 if c <= -4.6e+104: tmp = t_1 elif c <= -7.6e-19: tmp = c * (a * (i * -2.0)) elif c <= 2e+54: tmp = ((x * y) + (z * t)) * 2.0 else: tmp = t_1 return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(Float64(c * Float64(b * Float64(c * i))) * -2.0) tmp = 0.0 if (c <= -4.6e+104) tmp = t_1; elseif (c <= -7.6e-19) tmp = Float64(c * Float64(a * Float64(i * -2.0))); elseif (c <= 2e+54) tmp = Float64(Float64(Float64(x * y) + Float64(z * t)) * 2.0); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = (c * (b * (c * i))) * -2.0; tmp = 0.0; if (c <= -4.6e+104) tmp = t_1; elseif (c <= -7.6e-19) tmp = c * (a * (i * -2.0)); elseif (c <= 2e+54) tmp = ((x * y) + (z * t)) * 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[(c * N[(b * N[(c * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * -2.0), $MachinePrecision]}, If[LessEqual[c, -4.6e+104], t$95$1, If[LessEqual[c, -7.6e-19], N[(c * N[(a * N[(i * -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[c, 2e+54], N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(c \cdot \left(b \cdot \left(c \cdot i\right)\right)\right) \cdot -2\\
\mathbf{if}\;c \leq -4.6 \cdot 10^{+104}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;c \leq -7.6 \cdot 10^{-19}:\\
\;\;\;\;c \cdot \left(a \cdot \left(i \cdot -2\right)\right)\\
\mathbf{elif}\;c \leq 2 \cdot 10^{+54}:\\
\;\;\;\;\left(x \cdot y + z \cdot t\right) \cdot 2\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if c < -4.59999999999999969e104 or 2.0000000000000002e54 < c Initial program 82.4%
associate--l+82.4%
*-commutative82.4%
associate--l+82.4%
associate--l+82.4%
*-commutative82.4%
associate--l+82.4%
fma-define82.4%
*-commutative82.4%
associate-*l*92.9%
+-commutative92.9%
fma-define92.9%
Simplified92.9%
Taylor expanded in i around inf 80.9%
Taylor expanded in a around 0 71.8%
if -4.59999999999999969e104 < c < -7.6e-19Initial program 95.0%
associate--l+95.0%
*-commutative95.0%
associate--l+95.0%
associate--l+95.0%
*-commutative95.0%
associate--l+95.0%
fma-define95.0%
*-commutative95.0%
associate-*l*99.8%
+-commutative99.8%
fma-define99.8%
Simplified99.8%
Taylor expanded in a around inf 58.3%
*-commutative58.3%
*-commutative58.3%
associate-*l*58.3%
*-commutative58.3%
associate-*l*58.3%
associate-*l*58.3%
Simplified58.3%
if -7.6e-19 < c < 2.0000000000000002e54Initial program 97.1%
associate--l+97.1%
*-commutative97.1%
associate--l+97.1%
associate--l+97.1%
*-commutative97.1%
associate--l+97.1%
fma-define97.1%
*-commutative97.1%
associate-*l*88.9%
+-commutative88.9%
fma-define88.9%
Simplified88.9%
Taylor expanded in c around 0 73.5%
Final simplification71.7%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* (* c (* b (* c i))) -2.0)))
(if (<= c -3.2e-52)
t_1
(if (<= c 2.7e-25)
(* x (* y 2.0))
(if (<= c 1.65e+54) (* 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 = (c * (b * (c * i))) * -2.0;
double tmp;
if (c <= -3.2e-52) {
tmp = t_1;
} else if (c <= 2.7e-25) {
tmp = x * (y * 2.0);
} else if (c <= 1.65e+54) {
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 = (c * (b * (c * i))) * (-2.0d0)
if (c <= (-3.2d-52)) then
tmp = t_1
else if (c <= 2.7d-25) then
tmp = x * (y * 2.0d0)
else if (c <= 1.65d+54) 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 = (c * (b * (c * i))) * -2.0;
double tmp;
if (c <= -3.2e-52) {
tmp = t_1;
} else if (c <= 2.7e-25) {
tmp = x * (y * 2.0);
} else if (c <= 1.65e+54) {
tmp = c * (a * (i * -2.0));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = (c * (b * (c * i))) * -2.0 tmp = 0 if c <= -3.2e-52: tmp = t_1 elif c <= 2.7e-25: tmp = x * (y * 2.0) elif c <= 1.65e+54: 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(c * Float64(b * Float64(c * i))) * -2.0) tmp = 0.0 if (c <= -3.2e-52) tmp = t_1; elseif (c <= 2.7e-25) tmp = Float64(x * Float64(y * 2.0)); elseif (c <= 1.65e+54) tmp = Float64(c * Float64(a * Float64(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 = (c * (b * (c * i))) * -2.0; tmp = 0.0; if (c <= -3.2e-52) tmp = t_1; elseif (c <= 2.7e-25) tmp = x * (y * 2.0); elseif (c <= 1.65e+54) 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[(c * N[(b * N[(c * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * -2.0), $MachinePrecision]}, If[LessEqual[c, -3.2e-52], t$95$1, If[LessEqual[c, 2.7e-25], N[(x * N[(y * 2.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[c, 1.65e+54], N[(c * N[(a * N[(i * -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(c \cdot \left(b \cdot \left(c \cdot i\right)\right)\right) \cdot -2\\
\mathbf{if}\;c \leq -3.2 \cdot 10^{-52}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;c \leq 2.7 \cdot 10^{-25}:\\
\;\;\;\;x \cdot \left(y \cdot 2\right)\\
\mathbf{elif}\;c \leq 1.65 \cdot 10^{+54}:\\
\;\;\;\;c \cdot \left(a \cdot \left(i \cdot -2\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if c < -3.2000000000000001e-52 or 1.65e54 < c Initial program 85.3%
associate--l+85.3%
*-commutative85.3%
associate--l+85.3%
associate--l+85.3%
*-commutative85.3%
associate--l+85.3%
fma-define85.3%
*-commutative85.3%
associate-*l*93.6%
+-commutative93.6%
fma-define93.6%
Simplified93.6%
Taylor expanded in i around inf 78.4%
Taylor expanded in a around 0 64.2%
if -3.2000000000000001e-52 < c < 2.70000000000000016e-25Initial program 96.6%
associate--l+96.6%
*-commutative96.6%
associate--l+96.6%
associate--l+96.6%
*-commutative96.6%
associate--l+96.6%
fma-define96.6%
*-commutative96.6%
associate-*l*87.6%
+-commutative87.6%
fma-define87.6%
Simplified87.6%
Taylor expanded in x around inf 49.3%
*-commutative49.3%
associate-*l*49.3%
Simplified49.3%
if 2.70000000000000016e-25 < c < 1.65e54Initial program 99.7%
associate--l+99.7%
*-commutative99.7%
associate--l+99.7%
associate--l+99.7%
*-commutative99.7%
associate--l+99.7%
fma-define99.7%
*-commutative99.7%
associate-*l*99.9%
+-commutative99.9%
fma-define99.9%
Simplified99.9%
Taylor expanded in a around inf 56.2%
*-commutative56.2%
*-commutative56.2%
associate-*l*56.2%
*-commutative56.2%
associate-*l*56.2%
associate-*l*56.2%
Simplified56.2%
Final simplification56.9%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= c -2.95e-52) (not (<= c 1.3e-25))) (* (* 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.95e-52) || !(c <= 1.3e-25)) {
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.95d-52)) .or. (.not. (c <= 1.3d-25))) 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.95e-52) || !(c <= 1.3e-25)) {
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.95e-52) or not (c <= 1.3e-25): 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.95e-52) || !(c <= 1.3e-25)) tmp = Float64(Float64(c * Float64(Float64(a + Float64(b * c)) * i)) * -2.0); else tmp = Float64(Float64(Float64(x * y) + Float64(z * t)) * 2.0); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if ((c <= -2.95e-52) || ~((c <= 1.3e-25))) 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.95e-52], N[Not[LessEqual[c, 1.3e-25]], $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.95 \cdot 10^{-52} \lor \neg \left(c \leq 1.3 \cdot 10^{-25}\right):\\
\;\;\;\;\left(c \cdot \left(\left(a + b \cdot c\right) \cdot i\right)\right) \cdot -2\\
\mathbf{else}:\\
\;\;\;\;\left(x \cdot y + z \cdot t\right) \cdot 2\\
\end{array}
\end{array}
if c < -2.9500000000000001e-52 or 1.3e-25 < c Initial program 86.9%
associate--l+86.9%
*-commutative86.9%
associate--l+86.9%
associate--l+86.9%
*-commutative86.9%
associate--l+86.9%
fma-define86.9%
*-commutative86.9%
associate-*l*94.3%
+-commutative94.3%
fma-define94.3%
Simplified94.3%
Taylor expanded in i around inf 77.2%
if -2.9500000000000001e-52 < c < 1.3e-25Initial program 96.6%
associate--l+96.6%
*-commutative96.6%
associate--l+96.6%
associate--l+96.6%
*-commutative96.6%
associate--l+96.6%
fma-define96.6%
*-commutative96.6%
associate-*l*87.6%
+-commutative87.6%
fma-define87.6%
Simplified87.6%
Taylor expanded in c around 0 81.1%
Final simplification79.0%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= t -3.2e+49) (not (<= t 5.8e+99))) (* 2.0 (* z t)) (* x (* y 2.0))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((t <= -3.2e+49) || !(t <= 5.8e+99)) {
tmp = 2.0 * (z * t);
} else {
tmp = x * (y * 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 ((t <= (-3.2d+49)) .or. (.not. (t <= 5.8d+99))) then
tmp = 2.0d0 * (z * t)
else
tmp = x * (y * 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 ((t <= -3.2e+49) || !(t <= 5.8e+99)) {
tmp = 2.0 * (z * t);
} else {
tmp = x * (y * 2.0);
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if (t <= -3.2e+49) or not (t <= 5.8e+99): tmp = 2.0 * (z * t) else: tmp = x * (y * 2.0) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if ((t <= -3.2e+49) || !(t <= 5.8e+99)) tmp = Float64(2.0 * Float64(z * t)); else tmp = Float64(x * Float64(y * 2.0)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if ((t <= -3.2e+49) || ~((t <= 5.8e+99))) tmp = 2.0 * (z * t); else tmp = x * (y * 2.0); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[t, -3.2e+49], N[Not[LessEqual[t, 5.8e+99]], $MachinePrecision]], N[(2.0 * N[(z * t), $MachinePrecision]), $MachinePrecision], N[(x * N[(y * 2.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -3.2 \cdot 10^{+49} \lor \neg \left(t \leq 5.8 \cdot 10^{+99}\right):\\
\;\;\;\;2 \cdot \left(z \cdot t\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(y \cdot 2\right)\\
\end{array}
\end{array}
if t < -3.20000000000000014e49 or 5.8000000000000004e99 < t Initial program 89.0%
associate--l+89.0%
*-commutative89.0%
associate--l+89.0%
associate--l+89.0%
*-commutative89.0%
associate--l+89.0%
fma-define89.0%
*-commutative89.0%
associate-*l*89.0%
+-commutative89.0%
fma-define89.0%
Simplified89.0%
Taylor expanded in z around inf 51.1%
if -3.20000000000000014e49 < t < 5.8000000000000004e99Initial program 92.6%
associate--l+92.6%
*-commutative92.6%
associate--l+92.6%
associate--l+92.6%
*-commutative92.6%
associate--l+92.6%
fma-define92.6%
*-commutative92.6%
associate-*l*92.5%
+-commutative92.5%
fma-define92.5%
Simplified92.5%
Taylor expanded in x around inf 35.0%
*-commutative35.0%
associate-*l*35.0%
Simplified35.0%
Final simplification40.6%
(FPCore (x y z t a b c i) :precision binary64 (* 2.0 (* z t)))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return 2.0 * (z * t);
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
code = 2.0d0 * (z * t)
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return 2.0 * (z * t);
}
def code(x, y, z, t, a, b, c, i): return 2.0 * (z * t)
function code(x, y, z, t, a, b, c, i) return Float64(2.0 * Float64(z * t)) end
function tmp = code(x, y, z, t, a, b, c, i) tmp = 2.0 * (z * t); end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(2.0 * N[(z * t), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
2 \cdot \left(z \cdot t\right)
\end{array}
Initial program 91.3%
associate--l+91.3%
*-commutative91.3%
associate--l+91.3%
associate--l+91.3%
*-commutative91.3%
associate--l+91.3%
fma-define91.3%
*-commutative91.3%
associate-*l*91.3%
+-commutative91.3%
fma-define91.3%
Simplified91.3%
Taylor expanded in z around inf 26.0%
Final simplification26.0%
(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 2024144
(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))))