
(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 17 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 (* i (* c t_1))) INFINITY)
(* 2.0 (- t_2 (* t_1 (* c i))))
(* 2.0 (fma x y (* z t))))))
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 - (i * (c * t_1))) <= ((double) INFINITY)) {
tmp = 2.0 * (t_2 - (t_1 * (c * i)));
} else {
tmp = 2.0 * fma(x, y, (z * t));
}
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(i * Float64(c * t_1))) <= Inf) tmp = Float64(2.0 * Float64(t_2 - Float64(t_1 * Float64(c * i)))); else tmp = Float64(2.0 * fma(x, y, Float64(z * t))); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(t$95$2 - N[(i * N[(c * t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], Infinity], N[(2.0 * N[(t$95$2 - N[(t$95$1 * N[(c * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(x * y + N[(z * t), $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 - i \cdot \left(c \cdot t_1\right) \leq \infty:\\
\;\;\;\;2 \cdot \left(t_2 - t_1 \cdot \left(c \cdot i\right)\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \mathsf{fma}\left(x, y, z \cdot t\right)\\
\end{array}
\end{array}
if (-.f64 (+.f64 (*.f64 x y) (*.f64 z t)) (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i)) < +inf.0Initial program 94.8%
fma-def94.8%
associate-*l*98.4%
Simplified98.4%
fma-def98.4%
+-commutative98.4%
Applied egg-rr98.4%
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-def21.4%
associate-*l*42.9%
Simplified42.9%
fma-def21.4%
+-commutative21.4%
Applied egg-rr21.4%
Taylor expanded in c around 0 35.7%
*-commutative35.7%
+-commutative35.7%
fma-udef57.1%
*-commutative57.1%
Simplified57.1%
Final simplification96.1%
(FPCore (x y z t a b c i) :precision binary64 (* 2.0 (- (fma x y (* z t)) (* (+ a (* b c)) (* c i)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return 2.0 * (fma(x, y, (z * t)) - ((a + (b * c)) * (c * i)));
}
function code(x, y, z, t, a, b, c, i) return Float64(2.0 * Float64(fma(x, y, Float64(z * t)) - Float64(Float64(a + Float64(b * c)) * Float64(c * i)))) end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(2.0 * N[(N[(x * y + N[(z * t), $MachinePrecision]), $MachinePrecision] - N[(N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision] * N[(c * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
2 \cdot \left(\mathsf{fma}\left(x, y, z \cdot t\right) - \left(a + b \cdot c\right) \cdot \left(c \cdot i\right)\right)
\end{array}
Initial program 89.6%
fma-def90.8%
associate-*l*95.3%
Simplified95.3%
Final simplification95.3%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* 2.0 (* (* (+ a (* b c)) i) (- c)))))
(if (<= c -6.2e+100)
t_1
(if (<= c -5e+39)
(* 2.0 (- (* z t) (* a (* c i))))
(if (or (<= c -2.1e-8)
(and (not (<= c 5e-29))
(or (<= c 1.8e+51) (not (<= c 1.72e+71)))))
t_1
(* 2.0 (+ (* x y) (* z t))))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = 2.0 * (((a + (b * c)) * i) * -c);
double tmp;
if (c <= -6.2e+100) {
tmp = t_1;
} else if (c <= -5e+39) {
tmp = 2.0 * ((z * t) - (a * (c * i)));
} else if ((c <= -2.1e-8) || (!(c <= 5e-29) && ((c <= 1.8e+51) || !(c <= 1.72e+71)))) {
tmp = t_1;
} else {
tmp = 2.0 * ((x * y) + (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) :: t_1
real(8) :: tmp
t_1 = 2.0d0 * (((a + (b * c)) * i) * -c)
if (c <= (-6.2d+100)) then
tmp = t_1
else if (c <= (-5d+39)) then
tmp = 2.0d0 * ((z * t) - (a * (c * i)))
else if ((c <= (-2.1d-8)) .or. (.not. (c <= 5d-29)) .and. (c <= 1.8d+51) .or. (.not. (c <= 1.72d+71))) then
tmp = t_1
else
tmp = 2.0d0 * ((x * y) + (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 t_1 = 2.0 * (((a + (b * c)) * i) * -c);
double tmp;
if (c <= -6.2e+100) {
tmp = t_1;
} else if (c <= -5e+39) {
tmp = 2.0 * ((z * t) - (a * (c * i)));
} else if ((c <= -2.1e-8) || (!(c <= 5e-29) && ((c <= 1.8e+51) || !(c <= 1.72e+71)))) {
tmp = t_1;
} else {
tmp = 2.0 * ((x * y) + (z * t));
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = 2.0 * (((a + (b * c)) * i) * -c) tmp = 0 if c <= -6.2e+100: tmp = t_1 elif c <= -5e+39: tmp = 2.0 * ((z * t) - (a * (c * i))) elif (c <= -2.1e-8) or (not (c <= 5e-29) and ((c <= 1.8e+51) or not (c <= 1.72e+71))): tmp = t_1 else: tmp = 2.0 * ((x * y) + (z * t)) return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(2.0 * Float64(Float64(Float64(a + Float64(b * c)) * i) * Float64(-c))) tmp = 0.0 if (c <= -6.2e+100) tmp = t_1; elseif (c <= -5e+39) tmp = Float64(2.0 * Float64(Float64(z * t) - Float64(a * Float64(c * i)))); elseif ((c <= -2.1e-8) || (!(c <= 5e-29) && ((c <= 1.8e+51) || !(c <= 1.72e+71)))) tmp = t_1; else tmp = Float64(2.0 * Float64(Float64(x * y) + Float64(z * t))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = 2.0 * (((a + (b * c)) * i) * -c); tmp = 0.0; if (c <= -6.2e+100) tmp = t_1; elseif (c <= -5e+39) tmp = 2.0 * ((z * t) - (a * (c * i))); elseif ((c <= -2.1e-8) || (~((c <= 5e-29)) && ((c <= 1.8e+51) || ~((c <= 1.72e+71))))) tmp = t_1; else tmp = 2.0 * ((x * y) + (z * t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(2.0 * N[(N[(N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision] * i), $MachinePrecision] * (-c)), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[c, -6.2e+100], t$95$1, If[LessEqual[c, -5e+39], N[(2.0 * N[(N[(z * t), $MachinePrecision] - N[(a * N[(c * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[c, -2.1e-8], And[N[Not[LessEqual[c, 5e-29]], $MachinePrecision], Or[LessEqual[c, 1.8e+51], N[Not[LessEqual[c, 1.72e+71]], $MachinePrecision]]]], t$95$1, N[(2.0 * N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := 2 \cdot \left(\left(\left(a + b \cdot c\right) \cdot i\right) \cdot \left(-c\right)\right)\\
\mathbf{if}\;c \leq -6.2 \cdot 10^{+100}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;c \leq -5 \cdot 10^{+39}:\\
\;\;\;\;2 \cdot \left(z \cdot t - a \cdot \left(c \cdot i\right)\right)\\
\mathbf{elif}\;c \leq -2.1 \cdot 10^{-8} \lor \neg \left(c \leq 5 \cdot 10^{-29}\right) \land \left(c \leq 1.8 \cdot 10^{+51} \lor \neg \left(c \leq 1.72 \cdot 10^{+71}\right)\right):\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(x \cdot y + z \cdot t\right)\\
\end{array}
\end{array}
if c < -6.20000000000000014e100 or -5.00000000000000015e39 < c < -2.09999999999999994e-8 or 4.99999999999999986e-29 < c < 1.80000000000000005e51 or 1.72e71 < c Initial program 84.2%
Taylor expanded in i around inf 76.8%
if -6.20000000000000014e100 < c < -5.00000000000000015e39Initial program 64.3%
Taylor expanded in a around inf 81.7%
Taylor expanded in x around 0 82.1%
if -2.09999999999999994e-8 < c < 4.99999999999999986e-29 or 1.80000000000000005e51 < c < 1.72e71Initial program 95.6%
Taylor expanded in c around 0 81.9%
Final simplification79.8%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* 2.0 (* (* (+ a (* b c)) i) (- c)))))
(if (<= c -6.2e+100)
t_1
(if (<= c -6.8e+64)
(* 2.0 (- (* z t) (* a (* c i))))
(if (<= c -9.5e-28)
(* 2.0 (- (* x y) (* c (* b (* c i)))))
(if (or (<= c 5e-29) (and (not (<= c 1.1e+52)) (<= c 1.65e+71)))
(* 2.0 (+ (* x y) (* 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 + (b * c)) * i) * -c);
double tmp;
if (c <= -6.2e+100) {
tmp = t_1;
} else if (c <= -6.8e+64) {
tmp = 2.0 * ((z * t) - (a * (c * i)));
} else if (c <= -9.5e-28) {
tmp = 2.0 * ((x * y) - (c * (b * (c * i))));
} else if ((c <= 5e-29) || (!(c <= 1.1e+52) && (c <= 1.65e+71))) {
tmp = 2.0 * ((x * y) + (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 + (b * c)) * i) * -c)
if (c <= (-6.2d+100)) then
tmp = t_1
else if (c <= (-6.8d+64)) then
tmp = 2.0d0 * ((z * t) - (a * (c * i)))
else if (c <= (-9.5d-28)) then
tmp = 2.0d0 * ((x * y) - (c * (b * (c * i))))
else if ((c <= 5d-29) .or. (.not. (c <= 1.1d+52)) .and. (c <= 1.65d+71)) then
tmp = 2.0d0 * ((x * y) + (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 + (b * c)) * i) * -c);
double tmp;
if (c <= -6.2e+100) {
tmp = t_1;
} else if (c <= -6.8e+64) {
tmp = 2.0 * ((z * t) - (a * (c * i)));
} else if (c <= -9.5e-28) {
tmp = 2.0 * ((x * y) - (c * (b * (c * i))));
} else if ((c <= 5e-29) || (!(c <= 1.1e+52) && (c <= 1.65e+71))) {
tmp = 2.0 * ((x * y) + (z * t));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = 2.0 * (((a + (b * c)) * i) * -c) tmp = 0 if c <= -6.2e+100: tmp = t_1 elif c <= -6.8e+64: tmp = 2.0 * ((z * t) - (a * (c * i))) elif c <= -9.5e-28: tmp = 2.0 * ((x * y) - (c * (b * (c * i)))) elif (c <= 5e-29) or (not (c <= 1.1e+52) and (c <= 1.65e+71)): tmp = 2.0 * ((x * y) + (z * t)) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(2.0 * Float64(Float64(Float64(a + Float64(b * c)) * i) * Float64(-c))) tmp = 0.0 if (c <= -6.2e+100) tmp = t_1; elseif (c <= -6.8e+64) tmp = Float64(2.0 * Float64(Float64(z * t) - Float64(a * Float64(c * i)))); elseif (c <= -9.5e-28) tmp = Float64(2.0 * Float64(Float64(x * y) - Float64(c * Float64(b * Float64(c * i))))); elseif ((c <= 5e-29) || (!(c <= 1.1e+52) && (c <= 1.65e+71))) tmp = Float64(2.0 * Float64(Float64(x * y) + 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 + (b * c)) * i) * -c); tmp = 0.0; if (c <= -6.2e+100) tmp = t_1; elseif (c <= -6.8e+64) tmp = 2.0 * ((z * t) - (a * (c * i))); elseif (c <= -9.5e-28) tmp = 2.0 * ((x * y) - (c * (b * (c * i)))); elseif ((c <= 5e-29) || (~((c <= 1.1e+52)) && (c <= 1.65e+71))) tmp = 2.0 * ((x * y) + (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[(N[(N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision] * i), $MachinePrecision] * (-c)), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[c, -6.2e+100], t$95$1, If[LessEqual[c, -6.8e+64], N[(2.0 * N[(N[(z * t), $MachinePrecision] - N[(a * N[(c * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[c, -9.5e-28], N[(2.0 * N[(N[(x * y), $MachinePrecision] - N[(c * N[(b * N[(c * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[c, 5e-29], And[N[Not[LessEqual[c, 1.1e+52]], $MachinePrecision], LessEqual[c, 1.65e+71]]], N[(2.0 * N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := 2 \cdot \left(\left(\left(a + b \cdot c\right) \cdot i\right) \cdot \left(-c\right)\right)\\
\mathbf{if}\;c \leq -6.2 \cdot 10^{+100}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;c \leq -6.8 \cdot 10^{+64}:\\
\;\;\;\;2 \cdot \left(z \cdot t - a \cdot \left(c \cdot i\right)\right)\\
\mathbf{elif}\;c \leq -9.5 \cdot 10^{-28}:\\
\;\;\;\;2 \cdot \left(x \cdot y - c \cdot \left(b \cdot \left(c \cdot i\right)\right)\right)\\
\mathbf{elif}\;c \leq 5 \cdot 10^{-29} \lor \neg \left(c \leq 1.1 \cdot 10^{+52}\right) \land c \leq 1.65 \cdot 10^{+71}:\\
\;\;\;\;2 \cdot \left(x \cdot y + z \cdot t\right)\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if c < -6.20000000000000014e100 or 4.99999999999999986e-29 < c < 1.1e52 or 1.6499999999999999e71 < c Initial program 83.3%
Taylor expanded in i around inf 78.0%
if -6.20000000000000014e100 < c < -6.8000000000000003e64Initial program 58.1%
Taylor expanded in a around inf 85.5%
Taylor expanded in x around 0 99.8%
if -6.8000000000000003e64 < c < -9.50000000000000001e-28Initial program 90.6%
Taylor expanded in z around 0 76.3%
Taylor expanded in a around 0 70.4%
if -9.50000000000000001e-28 < c < 4.99999999999999986e-29 or 1.1e52 < c < 1.6499999999999999e71Initial program 95.4%
Taylor expanded in c around 0 82.7%
Final simplification80.5%
(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 (* i (* c t_1))) INFINITY)
(* 2.0 (- t_2 (* t_1 (* c i))))
(* 2.0 (- (* 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 = (x * y) + (z * t);
double tmp;
if ((t_2 - (i * (c * t_1))) <= ((double) INFINITY)) {
tmp = 2.0 * (t_2 - (t_1 * (c * i)));
} else {
tmp = 2.0 * ((z * t) - (a * (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 - (i * (c * t_1))) <= Double.POSITIVE_INFINITY) {
tmp = 2.0 * (t_2 - (t_1 * (c * i)));
} else {
tmp = 2.0 * ((z * t) - (a * (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 - (i * (c * t_1))) <= math.inf: tmp = 2.0 * (t_2 - (t_1 * (c * i))) else: tmp = 2.0 * ((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(x * y) + Float64(z * t)) tmp = 0.0 if (Float64(t_2 - Float64(i * Float64(c * t_1))) <= Inf) tmp = Float64(2.0 * Float64(t_2 - Float64(t_1 * Float64(c * i)))); else tmp = Float64(2.0 * Float64(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 = (x * y) + (z * t); tmp = 0.0; if ((t_2 - (i * (c * t_1))) <= Inf) tmp = 2.0 * (t_2 - (t_1 * (c * i))); else tmp = 2.0 * ((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[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(t$95$2 - N[(i * N[(c * t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], Infinity], N[(2.0 * N[(t$95$2 - N[(t$95$1 * N[(c * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[(z * t), $MachinePrecision] - N[(a * N[(c * i), $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 - i \cdot \left(c \cdot t_1\right) \leq \infty:\\
\;\;\;\;2 \cdot \left(t_2 - t_1 \cdot \left(c \cdot i\right)\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(z \cdot t - a \cdot \left(c \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.8%
fma-def94.8%
associate-*l*98.4%
Simplified98.4%
fma-def98.4%
+-commutative98.4%
Applied egg-rr98.4%
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 a around inf 35.7%
Taylor expanded in x around 0 50.6%
Final simplification95.8%
(FPCore (x y z t a b c i)
:precision binary64
(if (or (<= (* x y) -1e+86)
(and (not (<= (* x y) -5000000.0))
(or (<= (* x y) -6e-47) (not (<= (* x y) 1.5e+33)))))
(* 2.0 (+ (* x y) (* z t)))
(* 2.0 (- (* z t) (* a (* c i))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (((x * y) <= -1e+86) || (!((x * y) <= -5000000.0) && (((x * y) <= -6e-47) || !((x * y) <= 1.5e+33)))) {
tmp = 2.0 * ((x * y) + (z * t));
} else {
tmp = 2.0 * ((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) :: tmp
if (((x * y) <= (-1d+86)) .or. (.not. ((x * y) <= (-5000000.0d0))) .and. ((x * y) <= (-6d-47)) .or. (.not. ((x * y) <= 1.5d+33))) then
tmp = 2.0d0 * ((x * y) + (z * t))
else
tmp = 2.0d0 * ((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 tmp;
if (((x * y) <= -1e+86) || (!((x * y) <= -5000000.0) && (((x * y) <= -6e-47) || !((x * y) <= 1.5e+33)))) {
tmp = 2.0 * ((x * y) + (z * t));
} else {
tmp = 2.0 * ((z * t) - (a * (c * i)));
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if ((x * y) <= -1e+86) or (not ((x * y) <= -5000000.0) and (((x * y) <= -6e-47) or not ((x * y) <= 1.5e+33))): tmp = 2.0 * ((x * y) + (z * t)) else: tmp = 2.0 * ((z * t) - (a * (c * i))) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if ((Float64(x * y) <= -1e+86) || (!(Float64(x * y) <= -5000000.0) && ((Float64(x * y) <= -6e-47) || !(Float64(x * y) <= 1.5e+33)))) tmp = Float64(2.0 * Float64(Float64(x * y) + Float64(z * t))); else tmp = Float64(2.0 * Float64(Float64(z * t) - Float64(a * Float64(c * i)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if (((x * y) <= -1e+86) || (~(((x * y) <= -5000000.0)) && (((x * y) <= -6e-47) || ~(((x * y) <= 1.5e+33))))) tmp = 2.0 * ((x * y) + (z * t)); else tmp = 2.0 * ((z * t) - (a * (c * i))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[N[(x * y), $MachinePrecision], -1e+86], And[N[Not[LessEqual[N[(x * y), $MachinePrecision], -5000000.0]], $MachinePrecision], Or[LessEqual[N[(x * y), $MachinePrecision], -6e-47], N[Not[LessEqual[N[(x * y), $MachinePrecision], 1.5e+33]], $MachinePrecision]]]], N[(2.0 * N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[(z * t), $MachinePrecision] - N[(a * N[(c * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \cdot y \leq -1 \cdot 10^{+86} \lor \neg \left(x \cdot y \leq -5000000\right) \land \left(x \cdot y \leq -6 \cdot 10^{-47} \lor \neg \left(x \cdot y \leq 1.5 \cdot 10^{+33}\right)\right):\\
\;\;\;\;2 \cdot \left(x \cdot y + z \cdot t\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(z \cdot t - a \cdot \left(c \cdot i\right)\right)\\
\end{array}
\end{array}
if (*.f64 x y) < -1e86 or -5e6 < (*.f64 x y) < -6.00000000000000033e-47 or 1.49999999999999992e33 < (*.f64 x y) Initial program 85.5%
Taylor expanded in c around 0 80.1%
if -1e86 < (*.f64 x y) < -5e6 or -6.00000000000000033e-47 < (*.f64 x y) < 1.49999999999999992e33Initial program 92.9%
Taylor expanded in a around inf 68.1%
Taylor expanded in x around 0 60.9%
Final simplification69.5%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* c (* (+ a (* b c)) i))))
(if (<= c -6.2e+100)
(* 2.0 (- (* x y) t_1))
(if (or (<= c -1.3e+38) (and (not (<= c -3.3e-16)) (<= c 1.7e-15)))
(* 2.0 (- (+ (* x y) (* z t)) (* a (* c i))))
(* 2.0 (- (* z t) t_1))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = c * ((a + (b * c)) * i);
double tmp;
if (c <= -6.2e+100) {
tmp = 2.0 * ((x * y) - t_1);
} else if ((c <= -1.3e+38) || (!(c <= -3.3e-16) && (c <= 1.7e-15))) {
tmp = 2.0 * (((x * y) + (z * t)) - (a * (c * i)));
} else {
tmp = 2.0 * ((z * t) - t_1);
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: t_1
real(8) :: tmp
t_1 = c * ((a + (b * c)) * i)
if (c <= (-6.2d+100)) then
tmp = 2.0d0 * ((x * y) - t_1)
else if ((c <= (-1.3d+38)) .or. (.not. (c <= (-3.3d-16))) .and. (c <= 1.7d-15)) then
tmp = 2.0d0 * (((x * y) + (z * t)) - (a * (c * i)))
else
tmp = 2.0d0 * ((z * t) - t_1)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = c * ((a + (b * c)) * i);
double tmp;
if (c <= -6.2e+100) {
tmp = 2.0 * ((x * y) - t_1);
} else if ((c <= -1.3e+38) || (!(c <= -3.3e-16) && (c <= 1.7e-15))) {
tmp = 2.0 * (((x * y) + (z * t)) - (a * (c * i)));
} else {
tmp = 2.0 * ((z * t) - t_1);
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = c * ((a + (b * c)) * i) tmp = 0 if c <= -6.2e+100: tmp = 2.0 * ((x * y) - t_1) elif (c <= -1.3e+38) or (not (c <= -3.3e-16) and (c <= 1.7e-15)): tmp = 2.0 * (((x * y) + (z * t)) - (a * (c * i))) else: tmp = 2.0 * ((z * t) - t_1) return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(c * Float64(Float64(a + Float64(b * c)) * i)) tmp = 0.0 if (c <= -6.2e+100) tmp = Float64(2.0 * Float64(Float64(x * y) - t_1)); elseif ((c <= -1.3e+38) || (!(c <= -3.3e-16) && (c <= 1.7e-15))) tmp = Float64(2.0 * Float64(Float64(Float64(x * y) + Float64(z * t)) - Float64(a * Float64(c * i)))); else tmp = Float64(2.0 * Float64(Float64(z * t) - t_1)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = c * ((a + (b * c)) * i); tmp = 0.0; if (c <= -6.2e+100) tmp = 2.0 * ((x * y) - t_1); elseif ((c <= -1.3e+38) || (~((c <= -3.3e-16)) && (c <= 1.7e-15))) tmp = 2.0 * (((x * y) + (z * t)) - (a * (c * i))); else tmp = 2.0 * ((z * t) - t_1); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(c * N[(N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[c, -6.2e+100], N[(2.0 * N[(N[(x * y), $MachinePrecision] - t$95$1), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[c, -1.3e+38], And[N[Not[LessEqual[c, -3.3e-16]], $MachinePrecision], LessEqual[c, 1.7e-15]]], N[(2.0 * N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] - N[(a * N[(c * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[(z * t), $MachinePrecision] - t$95$1), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := c \cdot \left(\left(a + b \cdot c\right) \cdot i\right)\\
\mathbf{if}\;c \leq -6.2 \cdot 10^{+100}:\\
\;\;\;\;2 \cdot \left(x \cdot y - t_1\right)\\
\mathbf{elif}\;c \leq -1.3 \cdot 10^{+38} \lor \neg \left(c \leq -3.3 \cdot 10^{-16}\right) \land c \leq 1.7 \cdot 10^{-15}:\\
\;\;\;\;2 \cdot \left(\left(x \cdot y + z \cdot t\right) - a \cdot \left(c \cdot i\right)\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(z \cdot t - t_1\right)\\
\end{array}
\end{array}
if c < -6.20000000000000014e100Initial program 87.0%
Taylor expanded in z around 0 89.4%
if -6.20000000000000014e100 < c < -1.3e38 or -3.29999999999999988e-16 < c < 1.7e-15Initial program 95.1%
Taylor expanded in a around inf 92.5%
if -1.3e38 < c < -3.29999999999999988e-16 or 1.7e-15 < c Initial program 79.1%
Taylor expanded in x around 0 85.1%
Final simplification90.1%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* 2.0 (* z t))) (t_2 (* 2.0 (* x y))))
(if (<= (* x y) -2e+149)
t_2
(if (<= (* x y) -2e-251)
t_1
(if (<= (* x y) 2e-187)
(* 2.0 (* c (* a (- i))))
(if (<= (* x y) 1e+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 = 2.0 * (z * t);
double t_2 = 2.0 * (x * y);
double tmp;
if ((x * y) <= -2e+149) {
tmp = t_2;
} else if ((x * y) <= -2e-251) {
tmp = t_1;
} else if ((x * y) <= 2e-187) {
tmp = 2.0 * (c * (a * -i));
} else if ((x * y) <= 1e+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 = 2.0d0 * (z * t)
t_2 = 2.0d0 * (x * y)
if ((x * y) <= (-2d+149)) then
tmp = t_2
else if ((x * y) <= (-2d-251)) then
tmp = t_1
else if ((x * y) <= 2d-187) then
tmp = 2.0d0 * (c * (a * -i))
else if ((x * y) <= 1d+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 = 2.0 * (z * t);
double t_2 = 2.0 * (x * y);
double tmp;
if ((x * y) <= -2e+149) {
tmp = t_2;
} else if ((x * y) <= -2e-251) {
tmp = t_1;
} else if ((x * y) <= 2e-187) {
tmp = 2.0 * (c * (a * -i));
} else if ((x * y) <= 1e+99) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = 2.0 * (z * t) t_2 = 2.0 * (x * y) tmp = 0 if (x * y) <= -2e+149: tmp = t_2 elif (x * y) <= -2e-251: tmp = t_1 elif (x * y) <= 2e-187: tmp = 2.0 * (c * (a * -i)) elif (x * y) <= 1e+99: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(2.0 * Float64(z * t)) t_2 = Float64(2.0 * Float64(x * y)) tmp = 0.0 if (Float64(x * y) <= -2e+149) tmp = t_2; elseif (Float64(x * y) <= -2e-251) tmp = t_1; elseif (Float64(x * y) <= 2e-187) tmp = Float64(2.0 * Float64(c * Float64(a * Float64(-i)))); elseif (Float64(x * y) <= 1e+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 = 2.0 * (z * t); t_2 = 2.0 * (x * y); tmp = 0.0; if ((x * y) <= -2e+149) tmp = t_2; elseif ((x * y) <= -2e-251) tmp = t_1; elseif ((x * y) <= 2e-187) tmp = 2.0 * (c * (a * -i)); elseif ((x * y) <= 1e+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[(2.0 * N[(z * t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(2.0 * N[(x * y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x * y), $MachinePrecision], -2e+149], t$95$2, If[LessEqual[N[(x * y), $MachinePrecision], -2e-251], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], 2e-187], N[(2.0 * N[(c * N[(a * (-i)), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 1e+99], t$95$1, t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := 2 \cdot \left(z \cdot t\right)\\
t_2 := 2 \cdot \left(x \cdot y\right)\\
\mathbf{if}\;x \cdot y \leq -2 \cdot 10^{+149}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;x \cdot y \leq -2 \cdot 10^{-251}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \cdot y \leq 2 \cdot 10^{-187}:\\
\;\;\;\;2 \cdot \left(c \cdot \left(a \cdot \left(-i\right)\right)\right)\\
\mathbf{elif}\;x \cdot y \leq 10^{+99}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if (*.f64 x y) < -2.0000000000000001e149 or 9.9999999999999997e98 < (*.f64 x y) Initial program 82.1%
Taylor expanded in x around inf 67.8%
if -2.0000000000000001e149 < (*.f64 x y) < -2.00000000000000003e-251 or 2e-187 < (*.f64 x y) < 9.9999999999999997e98Initial program 94.7%
Taylor expanded in z around inf 40.8%
if -2.00000000000000003e-251 < (*.f64 x y) < 2e-187Initial program 87.6%
Taylor expanded in a around inf 39.6%
mul-1-neg39.6%
*-commutative39.6%
associate-*l*43.2%
Simplified43.2%
Final simplification49.2%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ a (* b c))) (t_2 (* i (* c t_1))))
(if (<= t_2 2e+305)
(* 2.0 (- (+ (* x y) (* z t)) t_2))
(* 2.0 (- (* x y) (* 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 = i * (c * t_1);
double tmp;
if (t_2 <= 2e+305) {
tmp = 2.0 * (((x * y) + (z * t)) - t_2);
} else {
tmp = 2.0 * ((x * y) - (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) :: tmp
t_1 = a + (b * c)
t_2 = i * (c * t_1)
if (t_2 <= 2d+305) then
tmp = 2.0d0 * (((x * y) + (z * t)) - t_2)
else
tmp = 2.0d0 * ((x * y) - (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 = i * (c * t_1);
double tmp;
if (t_2 <= 2e+305) {
tmp = 2.0 * (((x * y) + (z * t)) - t_2);
} else {
tmp = 2.0 * ((x * y) - (c * (t_1 * i)));
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = a + (b * c) t_2 = i * (c * t_1) tmp = 0 if t_2 <= 2e+305: tmp = 2.0 * (((x * y) + (z * t)) - t_2) else: tmp = 2.0 * ((x * y) - (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(i * Float64(c * t_1)) tmp = 0.0 if (t_2 <= 2e+305) tmp = Float64(2.0 * Float64(Float64(Float64(x * y) + Float64(z * t)) - t_2)); else tmp = Float64(2.0 * Float64(Float64(x * y) - 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 = i * (c * t_1); tmp = 0.0; if (t_2 <= 2e+305) tmp = 2.0 * (((x * y) + (z * t)) - t_2); else tmp = 2.0 * ((x * y) - (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[(i * N[(c * t$95$1), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, 2e+305], N[(2.0 * N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] - t$95$2), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[(x * y), $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 := i \cdot \left(c \cdot t_1\right)\\
\mathbf{if}\;t_2 \leq 2 \cdot 10^{+305}:\\
\;\;\;\;2 \cdot \left(\left(x \cdot y + z \cdot t\right) - t_2\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(x \cdot y - c \cdot \left(t_1 \cdot i\right)\right)\\
\end{array}
\end{array}
if (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 1.9999999999999999e305Initial program 95.3%
if 1.9999999999999999e305 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) Initial program 55.9%
Taylor expanded in z around 0 84.7%
Final simplification93.8%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= a -1.5e+84) (not (<= a 0.25))) (* 2.0 (- (+ (* x y) (* z t)) (* a (* c i)))) (* 2.0 (+ (* x y) (- (* z t) (* b (* c (* c i))))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((a <= -1.5e+84) || !(a <= 0.25)) {
tmp = 2.0 * (((x * y) + (z * t)) - (a * (c * i)));
} else {
tmp = 2.0 * ((x * y) + ((z * t) - (b * (c * (c * i)))));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: tmp
if ((a <= (-1.5d+84)) .or. (.not. (a <= 0.25d0))) then
tmp = 2.0d0 * (((x * y) + (z * t)) - (a * (c * i)))
else
tmp = 2.0d0 * ((x * y) + ((z * t) - (b * (c * (c * i)))))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((a <= -1.5e+84) || !(a <= 0.25)) {
tmp = 2.0 * (((x * y) + (z * t)) - (a * (c * i)));
} else {
tmp = 2.0 * ((x * y) + ((z * t) - (b * (c * (c * i)))));
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if (a <= -1.5e+84) or not (a <= 0.25): tmp = 2.0 * (((x * y) + (z * t)) - (a * (c * i))) else: tmp = 2.0 * ((x * y) + ((z * t) - (b * (c * (c * i))))) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if ((a <= -1.5e+84) || !(a <= 0.25)) tmp = Float64(2.0 * Float64(Float64(Float64(x * y) + Float64(z * t)) - Float64(a * Float64(c * i)))); else tmp = Float64(2.0 * Float64(Float64(x * y) + Float64(Float64(z * t) - Float64(b * Float64(c * Float64(c * i)))))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if ((a <= -1.5e+84) || ~((a <= 0.25))) tmp = 2.0 * (((x * y) + (z * t)) - (a * (c * i))); else tmp = 2.0 * ((x * y) + ((z * t) - (b * (c * (c * i))))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[a, -1.5e+84], N[Not[LessEqual[a, 0.25]], $MachinePrecision]], N[(2.0 * N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] - N[(a * N[(c * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[(x * y), $MachinePrecision] + N[(N[(z * t), $MachinePrecision] - N[(b * N[(c * N[(c * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -1.5 \cdot 10^{+84} \lor \neg \left(a \leq 0.25\right):\\
\;\;\;\;2 \cdot \left(\left(x \cdot y + z \cdot t\right) - a \cdot \left(c \cdot i\right)\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(x \cdot y + \left(z \cdot t - b \cdot \left(c \cdot \left(c \cdot i\right)\right)\right)\right)\\
\end{array}
\end{array}
if a < -1.49999999999999998e84 or 0.25 < a Initial program 85.3%
Taylor expanded in a around inf 89.1%
if -1.49999999999999998e84 < a < 0.25Initial program 92.4%
associate--l+92.4%
*-commutative92.4%
fma-def93.0%
*-commutative93.0%
+-commutative93.0%
fma-udef93.0%
associate-*r*96.2%
Applied egg-rr96.2%
Taylor expanded in b around inf 93.5%
fma-udef92.9%
*-commutative92.9%
associate-*l*89.3%
Applied egg-rr89.3%
Final simplification89.2%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ (* x y) (* z t))))
(if (or (<= a -1.034e+19) (not (<= a 0.25)))
(* 2.0 (- t_1 (* a (* c i))))
(* 2.0 (- t_1 (* i (* c (* b c))))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = (x * y) + (z * t);
double tmp;
if ((a <= -1.034e+19) || !(a <= 0.25)) {
tmp = 2.0 * (t_1 - (a * (c * i)));
} else {
tmp = 2.0 * (t_1 - (i * (c * (b * c))));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: t_1
real(8) :: tmp
t_1 = (x * y) + (z * t)
if ((a <= (-1.034d+19)) .or. (.not. (a <= 0.25d0))) then
tmp = 2.0d0 * (t_1 - (a * (c * i)))
else
tmp = 2.0d0 * (t_1 - (i * (c * (b * c))))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = (x * y) + (z * t);
double tmp;
if ((a <= -1.034e+19) || !(a <= 0.25)) {
tmp = 2.0 * (t_1 - (a * (c * i)));
} else {
tmp = 2.0 * (t_1 - (i * (c * (b * c))));
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = (x * y) + (z * t) tmp = 0 if (a <= -1.034e+19) or not (a <= 0.25): tmp = 2.0 * (t_1 - (a * (c * i))) else: tmp = 2.0 * (t_1 - (i * (c * (b * c)))) return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(Float64(x * y) + Float64(z * t)) tmp = 0.0 if ((a <= -1.034e+19) || !(a <= 0.25)) tmp = Float64(2.0 * Float64(t_1 - Float64(a * Float64(c * i)))); else tmp = Float64(2.0 * Float64(t_1 - Float64(i * Float64(c * Float64(b * c))))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = (x * y) + (z * t); tmp = 0.0; if ((a <= -1.034e+19) || ~((a <= 0.25))) tmp = 2.0 * (t_1 - (a * (c * i))); else tmp = 2.0 * (t_1 - (i * (c * (b * c)))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[a, -1.034e+19], N[Not[LessEqual[a, 0.25]], $MachinePrecision]], N[(2.0 * N[(t$95$1 - N[(a * N[(c * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(t$95$1 - N[(i * N[(c * N[(b * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot y + z \cdot t\\
\mathbf{if}\;a \leq -1.034 \cdot 10^{+19} \lor \neg \left(a \leq 0.25\right):\\
\;\;\;\;2 \cdot \left(t_1 - a \cdot \left(c \cdot i\right)\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(t_1 - i \cdot \left(c \cdot \left(b \cdot c\right)\right)\right)\\
\end{array}
\end{array}
if a < -1.034e19 or 0.25 < a Initial program 86.1%
Taylor expanded in a around inf 89.4%
if -1.034e19 < a < 0.25Initial program 92.4%
Taylor expanded in a around 0 91.0%
Final simplification90.3%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ (* x y) (* z t))))
(if (or (<= a -2.25e+83) (not (<= a 0.37)))
(* 2.0 (- t_1 (* a (* c i))))
(* 2.0 (- t_1 (* (* b c) (* c i)))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = (x * y) + (z * t);
double tmp;
if ((a <= -2.25e+83) || !(a <= 0.37)) {
tmp = 2.0 * (t_1 - (a * (c * i)));
} else {
tmp = 2.0 * (t_1 - ((b * c) * (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) :: tmp
t_1 = (x * y) + (z * t)
if ((a <= (-2.25d+83)) .or. (.not. (a <= 0.37d0))) then
tmp = 2.0d0 * (t_1 - (a * (c * i)))
else
tmp = 2.0d0 * (t_1 - ((b * c) * (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 = (x * y) + (z * t);
double tmp;
if ((a <= -2.25e+83) || !(a <= 0.37)) {
tmp = 2.0 * (t_1 - (a * (c * i)));
} else {
tmp = 2.0 * (t_1 - ((b * c) * (c * i)));
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = (x * y) + (z * t) tmp = 0 if (a <= -2.25e+83) or not (a <= 0.37): tmp = 2.0 * (t_1 - (a * (c * i))) else: tmp = 2.0 * (t_1 - ((b * c) * (c * i))) return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(Float64(x * y) + Float64(z * t)) tmp = 0.0 if ((a <= -2.25e+83) || !(a <= 0.37)) tmp = Float64(2.0 * Float64(t_1 - Float64(a * Float64(c * i)))); else tmp = Float64(2.0 * Float64(t_1 - Float64(Float64(b * c) * Float64(c * i)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = (x * y) + (z * t); tmp = 0.0; if ((a <= -2.25e+83) || ~((a <= 0.37))) tmp = 2.0 * (t_1 - (a * (c * i))); else tmp = 2.0 * (t_1 - ((b * c) * (c * i))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[a, -2.25e+83], N[Not[LessEqual[a, 0.37]], $MachinePrecision]], N[(2.0 * N[(t$95$1 - N[(a * N[(c * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(t$95$1 - N[(N[(b * c), $MachinePrecision] * N[(c * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot y + z \cdot t\\
\mathbf{if}\;a \leq -2.25 \cdot 10^{+83} \lor \neg \left(a \leq 0.37\right):\\
\;\;\;\;2 \cdot \left(t_1 - a \cdot \left(c \cdot i\right)\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(t_1 - \left(b \cdot c\right) \cdot \left(c \cdot i\right)\right)\\
\end{array}
\end{array}
if a < -2.25e83 or 0.37 < a Initial program 85.3%
Taylor expanded in a around inf 89.1%
if -2.25e83 < a < 0.37Initial program 92.4%
fma-def93.0%
associate-*l*96.1%
Simplified96.1%
fma-def95.4%
+-commutative95.4%
Applied egg-rr95.4%
Taylor expanded in a around 0 92.9%
Final simplification91.4%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* 2.0 (+ (* x y) (* z t)))))
(if (<= t -9.5e-118)
t_1
(if (<= t 7.5e-113)
(* 2.0 (- (* x y) (* i (* a c))))
(if (<= t 1.25e+188) t_1 (* 2.0 (- (* 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 = 2.0 * ((x * y) + (z * t));
double tmp;
if (t <= -9.5e-118) {
tmp = t_1;
} else if (t <= 7.5e-113) {
tmp = 2.0 * ((x * y) - (i * (a * c)));
} else if (t <= 1.25e+188) {
tmp = t_1;
} else {
tmp = 2.0 * ((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) :: tmp
t_1 = 2.0d0 * ((x * y) + (z * t))
if (t <= (-9.5d-118)) then
tmp = t_1
else if (t <= 7.5d-113) then
tmp = 2.0d0 * ((x * y) - (i * (a * c)))
else if (t <= 1.25d+188) then
tmp = t_1
else
tmp = 2.0d0 * ((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 = 2.0 * ((x * y) + (z * t));
double tmp;
if (t <= -9.5e-118) {
tmp = t_1;
} else if (t <= 7.5e-113) {
tmp = 2.0 * ((x * y) - (i * (a * c)));
} else if (t <= 1.25e+188) {
tmp = t_1;
} else {
tmp = 2.0 * ((z * t) - (a * (c * i)));
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = 2.0 * ((x * y) + (z * t)) tmp = 0 if t <= -9.5e-118: tmp = t_1 elif t <= 7.5e-113: tmp = 2.0 * ((x * y) - (i * (a * c))) elif t <= 1.25e+188: tmp = t_1 else: tmp = 2.0 * ((z * t) - (a * (c * i))) return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(2.0 * Float64(Float64(x * y) + Float64(z * t))) tmp = 0.0 if (t <= -9.5e-118) tmp = t_1; elseif (t <= 7.5e-113) tmp = Float64(2.0 * Float64(Float64(x * y) - Float64(i * Float64(a * c)))); elseif (t <= 1.25e+188) tmp = t_1; else tmp = Float64(2.0 * Float64(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 = 2.0 * ((x * y) + (z * t)); tmp = 0.0; if (t <= -9.5e-118) tmp = t_1; elseif (t <= 7.5e-113) tmp = 2.0 * ((x * y) - (i * (a * c))); elseif (t <= 1.25e+188) tmp = t_1; else tmp = 2.0 * ((z * t) - (a * (c * i))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(2.0 * N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -9.5e-118], t$95$1, If[LessEqual[t, 7.5e-113], N[(2.0 * N[(N[(x * y), $MachinePrecision] - N[(i * N[(a * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.25e+188], t$95$1, N[(2.0 * N[(N[(z * t), $MachinePrecision] - N[(a * N[(c * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := 2 \cdot \left(x \cdot y + z \cdot t\right)\\
\mathbf{if}\;t \leq -9.5 \cdot 10^{-118}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t \leq 7.5 \cdot 10^{-113}:\\
\;\;\;\;2 \cdot \left(x \cdot y - i \cdot \left(a \cdot c\right)\right)\\
\mathbf{elif}\;t \leq 1.25 \cdot 10^{+188}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(z \cdot t - a \cdot \left(c \cdot i\right)\right)\\
\end{array}
\end{array}
if t < -9.49999999999999931e-118 or 7.5000000000000002e-113 < t < 1.25e188Initial program 91.7%
Taylor expanded in c around 0 63.3%
if -9.49999999999999931e-118 < t < 7.5000000000000002e-113Initial program 94.0%
Taylor expanded in a around inf 68.3%
*-commutative68.3%
Simplified68.3%
Taylor expanded in z around 0 69.6%
*-commutative69.6%
*-commutative69.6%
associate-*l*65.5%
*-commutative65.5%
Simplified65.5%
if 1.25e188 < t Initial program 63.0%
Taylor expanded in a around inf 75.3%
Taylor expanded in x around 0 75.3%
Final simplification65.0%
(FPCore (x y z t a b c i)
:precision binary64
(if (or (<= z -1.6e+140)
(not
(or (<= z -1.18e+107) (and (not (<= z -2.2e+51)) (<= z 1.1e-172)))))
(* 2.0 (* z t))
(* 2.0 (* x y))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((z <= -1.6e+140) || !((z <= -1.18e+107) || (!(z <= -2.2e+51) && (z <= 1.1e-172)))) {
tmp = 2.0 * (z * t);
} else {
tmp = 2.0 * (x * y);
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: tmp
if ((z <= (-1.6d+140)) .or. (.not. (z <= (-1.18d+107)) .or. (.not. (z <= (-2.2d+51))) .and. (z <= 1.1d-172))) then
tmp = 2.0d0 * (z * t)
else
tmp = 2.0d0 * (x * y)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((z <= -1.6e+140) || !((z <= -1.18e+107) || (!(z <= -2.2e+51) && (z <= 1.1e-172)))) {
tmp = 2.0 * (z * t);
} else {
tmp = 2.0 * (x * y);
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if (z <= -1.6e+140) or not ((z <= -1.18e+107) or (not (z <= -2.2e+51) and (z <= 1.1e-172))): tmp = 2.0 * (z * t) else: tmp = 2.0 * (x * y) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if ((z <= -1.6e+140) || !((z <= -1.18e+107) || (!(z <= -2.2e+51) && (z <= 1.1e-172)))) tmp = Float64(2.0 * Float64(z * t)); else tmp = Float64(2.0 * Float64(x * y)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if ((z <= -1.6e+140) || ~(((z <= -1.18e+107) || (~((z <= -2.2e+51)) && (z <= 1.1e-172))))) tmp = 2.0 * (z * t); else tmp = 2.0 * (x * y); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[z, -1.6e+140], N[Not[Or[LessEqual[z, -1.18e+107], And[N[Not[LessEqual[z, -2.2e+51]], $MachinePrecision], LessEqual[z, 1.1e-172]]]], $MachinePrecision]], N[(2.0 * N[(z * t), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(x * y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.6 \cdot 10^{+140} \lor \neg \left(z \leq -1.18 \cdot 10^{+107} \lor \neg \left(z \leq -2.2 \cdot 10^{+51}\right) \land z \leq 1.1 \cdot 10^{-172}\right):\\
\;\;\;\;2 \cdot \left(z \cdot t\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(x \cdot y\right)\\
\end{array}
\end{array}
if z < -1.60000000000000005e140 or -1.18000000000000005e107 < z < -2.19999999999999992e51 or 1.10000000000000004e-172 < z Initial program 85.6%
Taylor expanded in z around inf 46.2%
if -1.60000000000000005e140 < z < -1.18000000000000005e107 or -2.19999999999999992e51 < z < 1.10000000000000004e-172Initial program 93.8%
Taylor expanded in x around inf 41.6%
Final simplification43.9%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= c -6.8e-91) (not (<= c 4.8e-44))) (* 2.0 (- (* z t) (* c (* (+ a (* b c)) i)))) (* 2.0 (+ (* x y) (* z t)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((c <= -6.8e-91) || !(c <= 4.8e-44)) {
tmp = 2.0 * ((z * t) - (c * ((a + (b * c)) * i)));
} else {
tmp = 2.0 * ((x * y) + (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 ((c <= (-6.8d-91)) .or. (.not. (c <= 4.8d-44))) then
tmp = 2.0d0 * ((z * t) - (c * ((a + (b * c)) * i)))
else
tmp = 2.0d0 * ((x * y) + (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 ((c <= -6.8e-91) || !(c <= 4.8e-44)) {
tmp = 2.0 * ((z * t) - (c * ((a + (b * c)) * i)));
} else {
tmp = 2.0 * ((x * y) + (z * t));
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if (c <= -6.8e-91) or not (c <= 4.8e-44): tmp = 2.0 * ((z * t) - (c * ((a + (b * c)) * i))) else: tmp = 2.0 * ((x * y) + (z * t)) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if ((c <= -6.8e-91) || !(c <= 4.8e-44)) tmp = Float64(2.0 * Float64(Float64(z * t) - Float64(c * Float64(Float64(a + Float64(b * c)) * i)))); else tmp = Float64(2.0 * Float64(Float64(x * y) + Float64(z * t))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if ((c <= -6.8e-91) || ~((c <= 4.8e-44))) tmp = 2.0 * ((z * t) - (c * ((a + (b * c)) * i))); else tmp = 2.0 * ((x * y) + (z * t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[c, -6.8e-91], N[Not[LessEqual[c, 4.8e-44]], $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[(2.0 * N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;c \leq -6.8 \cdot 10^{-91} \lor \neg \left(c \leq 4.8 \cdot 10^{-44}\right):\\
\;\;\;\;2 \cdot \left(z \cdot t - c \cdot \left(\left(a + b \cdot c\right) \cdot i\right)\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(x \cdot y + z \cdot t\right)\\
\end{array}
\end{array}
if c < -6.80000000000000053e-91 or 4.80000000000000017e-44 < c Initial program 83.8%
Taylor expanded in x around 0 80.1%
if -6.80000000000000053e-91 < c < 4.80000000000000017e-44Initial program 97.1%
Taylor expanded in c around 0 85.0%
Final simplification82.3%
(FPCore (x y z t a b c i) :precision binary64 (if (<= c 9.5e+133) (* 2.0 (+ (* x y) (* z t))) (* (* c i) (* a -2.0))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (c <= 9.5e+133) {
tmp = 2.0 * ((x * y) + (z * t));
} else {
tmp = (c * i) * (a * -2.0);
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: tmp
if (c <= 9.5d+133) then
tmp = 2.0d0 * ((x * y) + (z * t))
else
tmp = (c * i) * (a * (-2.0d0))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (c <= 9.5e+133) {
tmp = 2.0 * ((x * y) + (z * t));
} else {
tmp = (c * i) * (a * -2.0);
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if c <= 9.5e+133: tmp = 2.0 * ((x * y) + (z * t)) else: tmp = (c * i) * (a * -2.0) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (c <= 9.5e+133) tmp = Float64(2.0 * Float64(Float64(x * y) + Float64(z * t))); else tmp = Float64(Float64(c * i) * Float64(a * -2.0)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if (c <= 9.5e+133) tmp = 2.0 * ((x * y) + (z * t)); else tmp = (c * i) * (a * -2.0); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[c, 9.5e+133], N[(2.0 * N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(c * i), $MachinePrecision] * N[(a * -2.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;c \leq 9.5 \cdot 10^{+133}:\\
\;\;\;\;2 \cdot \left(x \cdot y + z \cdot t\right)\\
\mathbf{else}:\\
\;\;\;\;\left(c \cdot i\right) \cdot \left(a \cdot -2\right)\\
\end{array}
\end{array}
if c < 9.49999999999999996e133Initial program 91.5%
Taylor expanded in c around 0 63.6%
if 9.49999999999999996e133 < c Initial program 70.4%
Taylor expanded in a around inf 44.7%
Taylor expanded in x around 0 44.6%
Taylor expanded in t around 0 44.3%
*-commutative44.3%
*-commutative44.3%
associate-*l*44.3%
Simplified44.3%
Final simplification61.8%
(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 89.6%
Taylor expanded in z around inf 32.1%
Final simplification32.1%
(FPCore (x y z t a b c i) :precision binary64 (* 2.0 (- (+ (* x y) (* z t)) (* (+ a (* b c)) (* c i)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return 2.0 * (((x * y) + (z * t)) - ((a + (b * c)) * (c * i)));
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
code = 2.0d0 * (((x * y) + (z * t)) - ((a + (b * c)) * (c * i)))
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return 2.0 * (((x * y) + (z * t)) - ((a + (b * c)) * (c * i)));
}
def code(x, y, z, t, a, b, c, i): return 2.0 * (((x * y) + (z * t)) - ((a + (b * c)) * (c * i)))
function code(x, y, z, t, a, b, c, i) return Float64(2.0 * Float64(Float64(Float64(x * y) + Float64(z * t)) - Float64(Float64(a + Float64(b * c)) * Float64(c * i)))) end
function tmp = code(x, y, z, t, a, b, c, i) tmp = 2.0 * (((x * y) + (z * t)) - ((a + (b * c)) * (c * i))); end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(2.0 * N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] - N[(N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision] * N[(c * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
2 \cdot \left(\left(x \cdot y + z \cdot t\right) - \left(a + b \cdot c\right) \cdot \left(c \cdot i\right)\right)
\end{array}
herbie shell --seed 2024021
(FPCore (x y z t a b c i)
:name "Diagrams.ThreeD.Shapes:frustum from diagrams-lib-1.3.0.3, A"
:precision binary64
:herbie-target
(* 2.0 (- (+ (* x y) (* z t)) (* (+ a (* b c)) (* c i))))
(* 2.0 (- (+ (* x y) (* z t)) (* (* (+ a (* b c)) c) i))))