
(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 (- (* x y) (* c (* a 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 * ((x * y) - (c * (a * 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 * ((x * y) - (c * (a * 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 * ((x * y) - (c * (a * 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(x * y) - Float64(c * Float64(a * 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 * ((x * y) - (c * (a * 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[(x * y), $MachinePrecision] - N[(c * N[(a * 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 - \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(x \cdot y - c \cdot \left(a \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 96.9%
fma-define96.9%
associate-*l*98.7%
Simplified98.7%
fma-define98.7%
+-commutative98.7%
Applied egg-rr98.7%
if +inf.0 < (-.f64 (+.f64 (*.f64 x y) (*.f64 z t)) (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i)) Initial program 0.0%
Taylor expanded in a around inf 40.0%
*-commutative40.0%
Simplified40.0%
Taylor expanded in z around 0 40.1%
*-commutative40.1%
associate-*r*50.1%
*-commutative50.1%
Simplified50.1%
Final simplification96.8%
(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 -2e+88)
t_3
(if (<= t_2 2e+98)
(* 2.0 (+ (* x y) (- (* z t) (* c (* a i)))))
(if (<= t_2 5e+300) t_3 (* -2.0 (* c (* t_1 i))))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = a + (b * c);
double t_2 = (c * t_1) * i;
double t_3 = 2.0 * ((x * y) - t_2);
double tmp;
if (t_2 <= -2e+88) {
tmp = t_3;
} else if (t_2 <= 2e+98) {
tmp = 2.0 * ((x * y) + ((z * t) - (c * (a * i))));
} else if (t_2 <= 5e+300) {
tmp = t_3;
} else {
tmp = -2.0 * (c * (t_1 * i));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: tmp
t_1 = a + (b * c)
t_2 = (c * t_1) * i
t_3 = 2.0d0 * ((x * y) - t_2)
if (t_2 <= (-2d+88)) then
tmp = t_3
else if (t_2 <= 2d+98) then
tmp = 2.0d0 * ((x * y) + ((z * t) - (c * (a * i))))
else if (t_2 <= 5d+300) then
tmp = t_3
else
tmp = (-2.0d0) * (c * (t_1 * i))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = a + (b * c);
double t_2 = (c * t_1) * i;
double t_3 = 2.0 * ((x * y) - t_2);
double tmp;
if (t_2 <= -2e+88) {
tmp = t_3;
} else if (t_2 <= 2e+98) {
tmp = 2.0 * ((x * y) + ((z * t) - (c * (a * i))));
} else if (t_2 <= 5e+300) {
tmp = t_3;
} else {
tmp = -2.0 * (c * (t_1 * i));
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = a + (b * c) t_2 = (c * t_1) * i t_3 = 2.0 * ((x * y) - t_2) tmp = 0 if t_2 <= -2e+88: tmp = t_3 elif t_2 <= 2e+98: tmp = 2.0 * ((x * y) + ((z * t) - (c * (a * i)))) elif t_2 <= 5e+300: tmp = t_3 else: tmp = -2.0 * (c * (t_1 * i)) return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(a + Float64(b * c)) t_2 = Float64(Float64(c * t_1) * i) t_3 = Float64(2.0 * Float64(Float64(x * y) - t_2)) tmp = 0.0 if (t_2 <= -2e+88) tmp = t_3; elseif (t_2 <= 2e+98) tmp = Float64(2.0 * Float64(Float64(x * y) + Float64(Float64(z * t) - Float64(c * Float64(a * i))))); elseif (t_2 <= 5e+300) tmp = t_3; else tmp = Float64(-2.0 * Float64(c * Float64(t_1 * i))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = a + (b * c); t_2 = (c * t_1) * i; t_3 = 2.0 * ((x * y) - t_2); tmp = 0.0; if (t_2 <= -2e+88) tmp = t_3; elseif (t_2 <= 2e+98) tmp = 2.0 * ((x * y) + ((z * t) - (c * (a * i)))); elseif (t_2 <= 5e+300) tmp = t_3; else tmp = -2.0 * (c * (t_1 * i)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(c * t$95$1), $MachinePrecision] * i), $MachinePrecision]}, Block[{t$95$3 = N[(2.0 * N[(N[(x * y), $MachinePrecision] - t$95$2), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, -2e+88], t$95$3, If[LessEqual[t$95$2, 2e+98], N[(2.0 * N[(N[(x * y), $MachinePrecision] + N[(N[(z * t), $MachinePrecision] - N[(c * N[(a * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, 5e+300], t$95$3, N[(-2.0 * N[(c * N[(t$95$1 * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a + b \cdot c\\
t_2 := \left(c \cdot t\_1\right) \cdot i\\
t_3 := 2 \cdot \left(x \cdot y - t\_2\right)\\
\mathbf{if}\;t\_2 \leq -2 \cdot 10^{+88}:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;t\_2 \leq 2 \cdot 10^{+98}:\\
\;\;\;\;2 \cdot \left(x \cdot y + \left(z \cdot t - c \cdot \left(a \cdot i\right)\right)\right)\\
\mathbf{elif}\;t\_2 \leq 5 \cdot 10^{+300}:\\
\;\;\;\;t\_3\\
\mathbf{else}:\\
\;\;\;\;-2 \cdot \left(c \cdot \left(t\_1 \cdot i\right)\right)\\
\end{array}
\end{array}
if (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < -1.99999999999999992e88 or 2e98 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 5.00000000000000026e300Initial program 91.9%
Taylor expanded in x around inf 84.8%
if -1.99999999999999992e88 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 2e98Initial program 97.6%
Taylor expanded in a around inf 94.6%
*-commutative94.6%
Simplified94.6%
associate--l+94.6%
*-commutative94.6%
associate-*l*94.3%
*-commutative94.3%
Applied egg-rr94.3%
if 5.00000000000000026e300 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) Initial program 82.2%
fma-define82.2%
*-commutative82.2%
associate-*l*93.1%
+-commutative93.1%
fma-define93.1%
Simplified93.1%
Taylor expanded in i around inf 95.4%
Final simplification91.2%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ a (* b c))) (t_2 (* (* c t_1) i)))
(if (or (<= t_2 -2e+302) (not (<= t_2 5e+300)))
(* -2.0 (* c (* t_1 i)))
(* 2.0 (- (+ (* x y) (* z t)) (* i (* a c)))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = a + (b * c);
double t_2 = (c * t_1) * i;
double tmp;
if ((t_2 <= -2e+302) || !(t_2 <= 5e+300)) {
tmp = -2.0 * (c * (t_1 * i));
} else {
tmp = 2.0 * (((x * y) + (z * t)) - (i * (a * c)));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = a + (b * c)
t_2 = (c * t_1) * i
if ((t_2 <= (-2d+302)) .or. (.not. (t_2 <= 5d+300))) then
tmp = (-2.0d0) * (c * (t_1 * i))
else
tmp = 2.0d0 * (((x * y) + (z * t)) - (i * (a * c)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = a + (b * c);
double t_2 = (c * t_1) * i;
double tmp;
if ((t_2 <= -2e+302) || !(t_2 <= 5e+300)) {
tmp = -2.0 * (c * (t_1 * i));
} else {
tmp = 2.0 * (((x * y) + (z * t)) - (i * (a * c)));
}
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 <= -2e+302) or not (t_2 <= 5e+300): tmp = -2.0 * (c * (t_1 * i)) else: tmp = 2.0 * (((x * y) + (z * t)) - (i * (a * c))) return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(a + Float64(b * c)) t_2 = Float64(Float64(c * t_1) * i) tmp = 0.0 if ((t_2 <= -2e+302) || !(t_2 <= 5e+300)) tmp = Float64(-2.0 * Float64(c * Float64(t_1 * i))); else tmp = Float64(2.0 * Float64(Float64(Float64(x * y) + Float64(z * t)) - Float64(i * Float64(a * c)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = a + (b * c); t_2 = (c * t_1) * i; tmp = 0.0; if ((t_2 <= -2e+302) || ~((t_2 <= 5e+300))) tmp = -2.0 * (c * (t_1 * i)); else tmp = 2.0 * (((x * y) + (z * t)) - (i * (a * c))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(c * t$95$1), $MachinePrecision] * i), $MachinePrecision]}, If[Or[LessEqual[t$95$2, -2e+302], N[Not[LessEqual[t$95$2, 5e+300]], $MachinePrecision]], N[(-2.0 * N[(c * N[(t$95$1 * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] - N[(i * N[(a * c), $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 -2 \cdot 10^{+302} \lor \neg \left(t\_2 \leq 5 \cdot 10^{+300}\right):\\
\;\;\;\;-2 \cdot \left(c \cdot \left(t\_1 \cdot i\right)\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(\left(x \cdot y + z \cdot t\right) - i \cdot \left(a \cdot c\right)\right)\\
\end{array}
\end{array}
if (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < -2.0000000000000002e302 or 5.00000000000000026e300 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) Initial program 83.7%
fma-define83.7%
*-commutative83.7%
associate-*l*90.0%
+-commutative90.0%
fma-define90.0%
Simplified90.0%
Taylor expanded in i around inf 92.4%
if -2.0000000000000002e302 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 5.00000000000000026e300Initial program 98.2%
Taylor expanded in a around inf 92.4%
*-commutative92.4%
Simplified92.4%
Final simplification92.4%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ a (* b c))) (t_2 (* (* c t_1) i)))
(if (<= t_2 5e+300)
(* (- (+ (* x y) (* z t)) t_2) 2.0)
(* -2.0 (* c (* t_1 i))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = a + (b * c);
double t_2 = (c * t_1) * i;
double tmp;
if (t_2 <= 5e+300) {
tmp = (((x * y) + (z * t)) - t_2) * 2.0;
} else {
tmp = -2.0 * (c * (t_1 * i));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = a + (b * c)
t_2 = (c * t_1) * i
if (t_2 <= 5d+300) then
tmp = (((x * y) + (z * t)) - t_2) * 2.0d0
else
tmp = (-2.0d0) * (c * (t_1 * i))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = a + (b * c);
double t_2 = (c * t_1) * i;
double tmp;
if (t_2 <= 5e+300) {
tmp = (((x * y) + (z * t)) - t_2) * 2.0;
} else {
tmp = -2.0 * (c * (t_1 * i));
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = a + (b * c) t_2 = (c * t_1) * i tmp = 0 if t_2 <= 5e+300: tmp = (((x * y) + (z * t)) - t_2) * 2.0 else: tmp = -2.0 * (c * (t_1 * i)) return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(a + Float64(b * c)) t_2 = Float64(Float64(c * t_1) * i) tmp = 0.0 if (t_2 <= 5e+300) tmp = Float64(Float64(Float64(Float64(x * y) + Float64(z * t)) - t_2) * 2.0); else tmp = Float64(-2.0 * Float64(c * Float64(t_1 * i))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = a + (b * c); t_2 = (c * t_1) * i; tmp = 0.0; if (t_2 <= 5e+300) tmp = (((x * y) + (z * t)) - t_2) * 2.0; else tmp = -2.0 * (c * (t_1 * i)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(c * t$95$1), $MachinePrecision] * i), $MachinePrecision]}, If[LessEqual[t$95$2, 5e+300], N[(N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] - t$95$2), $MachinePrecision] * 2.0), $MachinePrecision], N[(-2.0 * N[(c * N[(t$95$1 * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a + b \cdot c\\
t_2 := \left(c \cdot t\_1\right) \cdot i\\
\mathbf{if}\;t\_2 \leq 5 \cdot 10^{+300}:\\
\;\;\;\;\left(\left(x \cdot y + z \cdot t\right) - t\_2\right) \cdot 2\\
\mathbf{else}:\\
\;\;\;\;-2 \cdot \left(c \cdot \left(t\_1 \cdot i\right)\right)\\
\end{array}
\end{array}
if (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 5.00000000000000026e300Initial program 95.3%
if 5.00000000000000026e300 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) Initial program 82.2%
fma-define82.2%
*-commutative82.2%
associate-*l*93.1%
+-commutative93.1%
fma-define93.1%
Simplified93.1%
Taylor expanded in i around inf 95.4%
Final simplification95.3%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* -2.0 (* c (* (+ a (* b c)) i)))))
(if (<= c -3.4e+25)
t_1
(if (<= c 2.4e-18)
(* (+ (* x y) (* z t)) 2.0)
(if (<= c 3.5e+64) (* 2.0 (- (* x y) (* c (* a i)))) t_1)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = -2.0 * (c * ((a + (b * c)) * i));
double tmp;
if (c <= -3.4e+25) {
tmp = t_1;
} else if (c <= 2.4e-18) {
tmp = ((x * y) + (z * t)) * 2.0;
} else if (c <= 3.5e+64) {
tmp = 2.0 * ((x * y) - (c * (a * i)));
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: t_1
real(8) :: tmp
t_1 = (-2.0d0) * (c * ((a + (b * c)) * i))
if (c <= (-3.4d+25)) then
tmp = t_1
else if (c <= 2.4d-18) then
tmp = ((x * y) + (z * t)) * 2.0d0
else if (c <= 3.5d+64) then
tmp = 2.0d0 * ((x * y) - (c * (a * i)))
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = -2.0 * (c * ((a + (b * c)) * i));
double tmp;
if (c <= -3.4e+25) {
tmp = t_1;
} else if (c <= 2.4e-18) {
tmp = ((x * y) + (z * t)) * 2.0;
} else if (c <= 3.5e+64) {
tmp = 2.0 * ((x * y) - (c * (a * i)));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = -2.0 * (c * ((a + (b * c)) * i)) tmp = 0 if c <= -3.4e+25: tmp = t_1 elif c <= 2.4e-18: tmp = ((x * y) + (z * t)) * 2.0 elif c <= 3.5e+64: tmp = 2.0 * ((x * y) - (c * (a * i))) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(-2.0 * Float64(c * Float64(Float64(a + Float64(b * c)) * i))) tmp = 0.0 if (c <= -3.4e+25) tmp = t_1; elseif (c <= 2.4e-18) tmp = Float64(Float64(Float64(x * y) + Float64(z * t)) * 2.0); elseif (c <= 3.5e+64) tmp = Float64(2.0 * Float64(Float64(x * y) - Float64(c * Float64(a * i)))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = -2.0 * (c * ((a + (b * c)) * i)); tmp = 0.0; if (c <= -3.4e+25) tmp = t_1; elseif (c <= 2.4e-18) tmp = ((x * y) + (z * t)) * 2.0; elseif (c <= 3.5e+64) tmp = 2.0 * ((x * y) - (c * (a * i))); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(-2.0 * N[(c * N[(N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[c, -3.4e+25], t$95$1, If[LessEqual[c, 2.4e-18], N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision], If[LessEqual[c, 3.5e+64], N[(2.0 * N[(N[(x * y), $MachinePrecision] - N[(c * N[(a * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := -2 \cdot \left(c \cdot \left(\left(a + b \cdot c\right) \cdot i\right)\right)\\
\mathbf{if}\;c \leq -3.4 \cdot 10^{+25}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;c \leq 2.4 \cdot 10^{-18}:\\
\;\;\;\;\left(x \cdot y + z \cdot t\right) \cdot 2\\
\mathbf{elif}\;c \leq 3.5 \cdot 10^{+64}:\\
\;\;\;\;2 \cdot \left(x \cdot y - c \cdot \left(a \cdot i\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if c < -3.39999999999999984e25 or 3.4999999999999999e64 < c Initial program 87.0%
fma-define87.0%
*-commutative87.0%
associate-*l*92.4%
+-commutative92.4%
fma-define92.4%
Simplified92.4%
Taylor expanded in i around inf 75.8%
if -3.39999999999999984e25 < c < 2.39999999999999994e-18Initial program 97.8%
fma-define97.8%
*-commutative97.8%
associate-*l*90.7%
+-commutative90.7%
fma-define90.7%
Simplified90.7%
Taylor expanded in c around 0 79.7%
if 2.39999999999999994e-18 < c < 3.4999999999999999e64Initial program 93.2%
Taylor expanded in a around inf 80.2%
*-commutative80.2%
Simplified80.2%
Taylor expanded in z around 0 86.9%
*-commutative86.9%
associate-*r*86.8%
*-commutative86.8%
Simplified86.8%
Final simplification78.5%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= c -1.96e+111) (not (<= c 1.1e+119))) (* -2.0 (* c (* (+ a (* b c)) i))) (* 2.0 (+ (* x y) (- (* z t) (* c (* a i)))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((c <= -1.96e+111) || !(c <= 1.1e+119)) {
tmp = -2.0 * (c * ((a + (b * c)) * i));
} else {
tmp = 2.0 * ((x * y) + ((z * t) - (c * (a * i))));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: tmp
if ((c <= (-1.96d+111)) .or. (.not. (c <= 1.1d+119))) then
tmp = (-2.0d0) * (c * ((a + (b * c)) * i))
else
tmp = 2.0d0 * ((x * y) + ((z * t) - (c * (a * i))))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((c <= -1.96e+111) || !(c <= 1.1e+119)) {
tmp = -2.0 * (c * ((a + (b * c)) * i));
} else {
tmp = 2.0 * ((x * y) + ((z * t) - (c * (a * i))));
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if (c <= -1.96e+111) or not (c <= 1.1e+119): tmp = -2.0 * (c * ((a + (b * c)) * i)) else: tmp = 2.0 * ((x * y) + ((z * t) - (c * (a * i)))) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if ((c <= -1.96e+111) || !(c <= 1.1e+119)) tmp = Float64(-2.0 * Float64(c * Float64(Float64(a + Float64(b * c)) * i))); else tmp = Float64(2.0 * Float64(Float64(x * y) + Float64(Float64(z * t) - Float64(c * Float64(a * i))))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if ((c <= -1.96e+111) || ~((c <= 1.1e+119))) tmp = -2.0 * (c * ((a + (b * c)) * i)); else tmp = 2.0 * ((x * y) + ((z * t) - (c * (a * i)))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[c, -1.96e+111], N[Not[LessEqual[c, 1.1e+119]], $MachinePrecision]], N[(-2.0 * N[(c * N[(N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[(x * y), $MachinePrecision] + N[(N[(z * t), $MachinePrecision] - N[(c * N[(a * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;c \leq -1.96 \cdot 10^{+111} \lor \neg \left(c \leq 1.1 \cdot 10^{+119}\right):\\
\;\;\;\;-2 \cdot \left(c \cdot \left(\left(a + b \cdot c\right) \cdot i\right)\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(x \cdot y + \left(z \cdot t - c \cdot \left(a \cdot i\right)\right)\right)\\
\end{array}
\end{array}
if c < -1.96000000000000001e111 or 1.1000000000000001e119 < c Initial program 86.2%
fma-define86.2%
*-commutative86.2%
associate-*l*92.9%
+-commutative92.9%
fma-define92.9%
Simplified92.9%
Taylor expanded in i around inf 84.7%
if -1.96000000000000001e111 < c < 1.1000000000000001e119Initial program 95.7%
Taylor expanded in a around inf 89.5%
*-commutative89.5%
Simplified89.5%
associate--l+89.5%
*-commutative89.5%
associate-*l*84.1%
*-commutative84.1%
Applied egg-rr84.1%
Final simplification84.2%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* c (* (+ a (* b c)) i))))
(if (<= c -1.8e+108)
(* 2.0 (- (* z t) t_1))
(if (<= c 7.2e+114)
(* 2.0 (+ (* x y) (- (* z t) (* 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 * ((a + (b * c)) * i);
double tmp;
if (c <= -1.8e+108) {
tmp = 2.0 * ((z * t) - t_1);
} else if (c <= 7.2e+114) {
tmp = 2.0 * ((x * y) + ((z * t) - (c * (a * i))));
} else {
tmp = -2.0 * 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 <= (-1.8d+108)) then
tmp = 2.0d0 * ((z * t) - t_1)
else if (c <= 7.2d+114) then
tmp = 2.0d0 * ((x * y) + ((z * t) - (c * (a * i))))
else
tmp = (-2.0d0) * 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 <= -1.8e+108) {
tmp = 2.0 * ((z * t) - t_1);
} else if (c <= 7.2e+114) {
tmp = 2.0 * ((x * y) + ((z * t) - (c * (a * i))));
} else {
tmp = -2.0 * 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 <= -1.8e+108: tmp = 2.0 * ((z * t) - t_1) elif c <= 7.2e+114: tmp = 2.0 * ((x * y) + ((z * t) - (c * (a * i)))) else: tmp = -2.0 * 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 <= -1.8e+108) tmp = Float64(2.0 * Float64(Float64(z * t) - t_1)); elseif (c <= 7.2e+114) tmp = Float64(2.0 * Float64(Float64(x * y) + Float64(Float64(z * t) - Float64(c * Float64(a * i))))); else tmp = Float64(-2.0 * 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 <= -1.8e+108) tmp = 2.0 * ((z * t) - t_1); elseif (c <= 7.2e+114) tmp = 2.0 * ((x * y) + ((z * t) - (c * (a * i)))); else tmp = -2.0 * 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, -1.8e+108], N[(2.0 * N[(N[(z * t), $MachinePrecision] - t$95$1), $MachinePrecision]), $MachinePrecision], If[LessEqual[c, 7.2e+114], N[(2.0 * N[(N[(x * y), $MachinePrecision] + N[(N[(z * t), $MachinePrecision] - N[(c * N[(a * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(-2.0 * t$95$1), $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 -1.8 \cdot 10^{+108}:\\
\;\;\;\;2 \cdot \left(z \cdot t - t\_1\right)\\
\mathbf{elif}\;c \leq 7.2 \cdot 10^{+114}:\\
\;\;\;\;2 \cdot \left(x \cdot y + \left(z \cdot t - c \cdot \left(a \cdot i\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;-2 \cdot t\_1\\
\end{array}
\end{array}
if c < -1.8e108Initial program 81.7%
fma-define81.7%
*-commutative81.7%
associate-*l*91.8%
+-commutative91.8%
fma-define91.8%
Simplified91.8%
Taylor expanded in x around 0 91.8%
if -1.8e108 < c < 7.2000000000000001e114Initial program 95.7%
Taylor expanded in a around inf 89.5%
*-commutative89.5%
Simplified89.5%
associate--l+89.5%
*-commutative89.5%
associate-*l*84.1%
*-commutative84.1%
Applied egg-rr84.1%
if 7.2000000000000001e114 < c Initial program 91.2%
fma-define91.2%
*-commutative91.2%
associate-*l*94.1%
+-commutative94.1%
fma-define94.1%
Simplified94.1%
Taylor expanded in i around inf 79.6%
Final simplification84.6%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* -2.0 (* c (* (* b c) i)))))
(if (<= c -3.8e+52)
t_1
(if (<= c 5.2e-83)
(* t (* z 2.0))
(if (<= c 1.75e+68) (* x (* y 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 = -2.0 * (c * ((b * c) * i));
double tmp;
if (c <= -3.8e+52) {
tmp = t_1;
} else if (c <= 5.2e-83) {
tmp = t * (z * 2.0);
} else if (c <= 1.75e+68) {
tmp = x * (y * 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 = (-2.0d0) * (c * ((b * c) * i))
if (c <= (-3.8d+52)) then
tmp = t_1
else if (c <= 5.2d-83) then
tmp = t * (z * 2.0d0)
else if (c <= 1.75d+68) then
tmp = x * (y * 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 = -2.0 * (c * ((b * c) * i));
double tmp;
if (c <= -3.8e+52) {
tmp = t_1;
} else if (c <= 5.2e-83) {
tmp = t * (z * 2.0);
} else if (c <= 1.75e+68) {
tmp = x * (y * 2.0);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = -2.0 * (c * ((b * c) * i)) tmp = 0 if c <= -3.8e+52: tmp = t_1 elif c <= 5.2e-83: tmp = t * (z * 2.0) elif c <= 1.75e+68: tmp = x * (y * 2.0) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(-2.0 * Float64(c * Float64(Float64(b * c) * i))) tmp = 0.0 if (c <= -3.8e+52) tmp = t_1; elseif (c <= 5.2e-83) tmp = Float64(t * Float64(z * 2.0)); elseif (c <= 1.75e+68) tmp = Float64(x * Float64(y * 2.0)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = -2.0 * (c * ((b * c) * i)); tmp = 0.0; if (c <= -3.8e+52) tmp = t_1; elseif (c <= 5.2e-83) tmp = t * (z * 2.0); elseif (c <= 1.75e+68) tmp = x * (y * 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[(-2.0 * N[(c * N[(N[(b * c), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[c, -3.8e+52], t$95$1, If[LessEqual[c, 5.2e-83], N[(t * N[(z * 2.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[c, 1.75e+68], N[(x * N[(y * 2.0), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := -2 \cdot \left(c \cdot \left(\left(b \cdot c\right) \cdot i\right)\right)\\
\mathbf{if}\;c \leq -3.8 \cdot 10^{+52}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;c \leq 5.2 \cdot 10^{-83}:\\
\;\;\;\;t \cdot \left(z \cdot 2\right)\\
\mathbf{elif}\;c \leq 1.75 \cdot 10^{+68}:\\
\;\;\;\;x \cdot \left(y \cdot 2\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if c < -3.8e52 or 1.74999999999999989e68 < c Initial program 85.7%
fma-define85.7%
*-commutative85.7%
associate-*l*91.6%
+-commutative91.6%
fma-define91.6%
Simplified91.6%
Taylor expanded in i around inf 77.3%
Taylor expanded in a around 0 66.1%
*-commutative66.1%
Simplified66.1%
if -3.8e52 < c < 5.20000000000000018e-83Initial program 97.7%
fma-define97.7%
*-commutative97.7%
associate-*l*91.0%
+-commutative91.0%
fma-define91.0%
Simplified91.0%
Taylor expanded in z around inf 44.5%
*-commutative44.5%
*-commutative44.5%
*-commutative44.5%
associate-*r*44.5%
Simplified44.5%
if 5.20000000000000018e-83 < c < 1.74999999999999989e68Initial program 96.7%
fma-define96.7%
*-commutative96.7%
associate-*l*93.4%
+-commutative93.4%
fma-define93.4%
Simplified93.4%
Taylor expanded in x around inf 53.3%
*-commutative53.3%
associate-*l*53.3%
Simplified53.3%
Final simplification53.6%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* -2.0 (* c (* b (* c i))))))
(if (<= c -2e+51)
t_1
(if (<= c 1.98e-84)
(* t (* z 2.0))
(if (<= c 1.05e+68) (* x (* y 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 = -2.0 * (c * (b * (c * i)));
double tmp;
if (c <= -2e+51) {
tmp = t_1;
} else if (c <= 1.98e-84) {
tmp = t * (z * 2.0);
} else if (c <= 1.05e+68) {
tmp = x * (y * 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 = (-2.0d0) * (c * (b * (c * i)))
if (c <= (-2d+51)) then
tmp = t_1
else if (c <= 1.98d-84) then
tmp = t * (z * 2.0d0)
else if (c <= 1.05d+68) then
tmp = x * (y * 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 = -2.0 * (c * (b * (c * i)));
double tmp;
if (c <= -2e+51) {
tmp = t_1;
} else if (c <= 1.98e-84) {
tmp = t * (z * 2.0);
} else if (c <= 1.05e+68) {
tmp = x * (y * 2.0);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = -2.0 * (c * (b * (c * i))) tmp = 0 if c <= -2e+51: tmp = t_1 elif c <= 1.98e-84: tmp = t * (z * 2.0) elif c <= 1.05e+68: tmp = x * (y * 2.0) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(-2.0 * Float64(c * Float64(b * Float64(c * i)))) tmp = 0.0 if (c <= -2e+51) tmp = t_1; elseif (c <= 1.98e-84) tmp = Float64(t * Float64(z * 2.0)); elseif (c <= 1.05e+68) tmp = Float64(x * Float64(y * 2.0)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = -2.0 * (c * (b * (c * i))); tmp = 0.0; if (c <= -2e+51) tmp = t_1; elseif (c <= 1.98e-84) tmp = t * (z * 2.0); elseif (c <= 1.05e+68) tmp = x * (y * 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[(-2.0 * N[(c * N[(b * N[(c * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[c, -2e+51], t$95$1, If[LessEqual[c, 1.98e-84], N[(t * N[(z * 2.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[c, 1.05e+68], N[(x * N[(y * 2.0), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := -2 \cdot \left(c \cdot \left(b \cdot \left(c \cdot i\right)\right)\right)\\
\mathbf{if}\;c \leq -2 \cdot 10^{+51}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;c \leq 1.98 \cdot 10^{-84}:\\
\;\;\;\;t \cdot \left(z \cdot 2\right)\\
\mathbf{elif}\;c \leq 1.05 \cdot 10^{+68}:\\
\;\;\;\;x \cdot \left(y \cdot 2\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if c < -2e51 or 1.05e68 < c Initial program 85.7%
fma-define85.7%
*-commutative85.7%
associate-*l*91.6%
+-commutative91.6%
fma-define91.6%
Simplified91.6%
Taylor expanded in i around inf 77.3%
Taylor expanded in a around 0 66.1%
if -2e51 < c < 1.97999999999999995e-84Initial program 97.7%
fma-define97.7%
*-commutative97.7%
associate-*l*91.0%
+-commutative91.0%
fma-define91.0%
Simplified91.0%
Taylor expanded in z around inf 44.5%
*-commutative44.5%
*-commutative44.5%
*-commutative44.5%
associate-*r*44.5%
Simplified44.5%
if 1.97999999999999995e-84 < c < 1.05e68Initial program 96.7%
fma-define96.7%
*-commutative96.7%
associate-*l*93.4%
+-commutative93.4%
fma-define93.4%
Simplified93.4%
Taylor expanded in x around inf 53.3%
*-commutative53.3%
associate-*l*53.3%
Simplified53.3%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= c -5.2e+24) (not (<= c 3.2e+114))) (* -2.0 (* c (* (+ a (* b c)) i))) (* (+ (* x y) (* z t)) 2.0)))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((c <= -5.2e+24) || !(c <= 3.2e+114)) {
tmp = -2.0 * (c * ((a + (b * c)) * i));
} else {
tmp = ((x * y) + (z * t)) * 2.0;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: tmp
if ((c <= (-5.2d+24)) .or. (.not. (c <= 3.2d+114))) then
tmp = (-2.0d0) * (c * ((a + (b * c)) * i))
else
tmp = ((x * y) + (z * t)) * 2.0d0
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((c <= -5.2e+24) || !(c <= 3.2e+114)) {
tmp = -2.0 * (c * ((a + (b * c)) * i));
} else {
tmp = ((x * y) + (z * t)) * 2.0;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if (c <= -5.2e+24) or not (c <= 3.2e+114): tmp = -2.0 * (c * ((a + (b * c)) * i)) else: tmp = ((x * y) + (z * t)) * 2.0 return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if ((c <= -5.2e+24) || !(c <= 3.2e+114)) tmp = Float64(-2.0 * Float64(c * Float64(Float64(a + Float64(b * c)) * i))); else tmp = Float64(Float64(Float64(x * y) + Float64(z * t)) * 2.0); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if ((c <= -5.2e+24) || ~((c <= 3.2e+114))) tmp = -2.0 * (c * ((a + (b * c)) * i)); else tmp = ((x * y) + (z * t)) * 2.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[c, -5.2e+24], N[Not[LessEqual[c, 3.2e+114]], $MachinePrecision]], N[(-2.0 * N[(c * N[(N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;c \leq -5.2 \cdot 10^{+24} \lor \neg \left(c \leq 3.2 \cdot 10^{+114}\right):\\
\;\;\;\;-2 \cdot \left(c \cdot \left(\left(a + b \cdot c\right) \cdot i\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(x \cdot y + z \cdot t\right) \cdot 2\\
\end{array}
\end{array}
if c < -5.1999999999999997e24 or 3.2e114 < c Initial program 88.6%
fma-define88.6%
*-commutative88.6%
associate-*l*94.6%
+-commutative94.6%
fma-define94.6%
Simplified94.6%
Taylor expanded in i around inf 79.0%
if -5.1999999999999997e24 < c < 3.2e114Initial program 95.7%
fma-define95.7%
*-commutative95.7%
associate-*l*89.7%
+-commutative89.7%
fma-define89.7%
Simplified89.7%
Taylor expanded in c around 0 75.3%
Final simplification76.7%
(FPCore (x y z t a b c i)
:precision binary64
(if (<= c -1.25e+79)
(* -2.0 (* c (* (* b c) i)))
(if (<= c 2.7e+184)
(* (+ (* x y) (* z t)) 2.0)
(* -2.0 (* c (* b (* c i)))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (c <= -1.25e+79) {
tmp = -2.0 * (c * ((b * c) * i));
} else if (c <= 2.7e+184) {
tmp = ((x * y) + (z * t)) * 2.0;
} else {
tmp = -2.0 * (c * (b * (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 (c <= (-1.25d+79)) then
tmp = (-2.0d0) * (c * ((b * c) * i))
else if (c <= 2.7d+184) then
tmp = ((x * y) + (z * t)) * 2.0d0
else
tmp = (-2.0d0) * (c * (b * (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 (c <= -1.25e+79) {
tmp = -2.0 * (c * ((b * c) * i));
} else if (c <= 2.7e+184) {
tmp = ((x * y) + (z * t)) * 2.0;
} else {
tmp = -2.0 * (c * (b * (c * i)));
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if c <= -1.25e+79: tmp = -2.0 * (c * ((b * c) * i)) elif c <= 2.7e+184: tmp = ((x * y) + (z * t)) * 2.0 else: tmp = -2.0 * (c * (b * (c * i))) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (c <= -1.25e+79) tmp = Float64(-2.0 * Float64(c * Float64(Float64(b * c) * i))); elseif (c <= 2.7e+184) tmp = Float64(Float64(Float64(x * y) + Float64(z * t)) * 2.0); else tmp = Float64(-2.0 * Float64(c * Float64(b * Float64(c * i)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if (c <= -1.25e+79) tmp = -2.0 * (c * ((b * c) * i)); elseif (c <= 2.7e+184) tmp = ((x * y) + (z * t)) * 2.0; else tmp = -2.0 * (c * (b * (c * i))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[c, -1.25e+79], N[(-2.0 * N[(c * N[(N[(b * c), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[c, 2.7e+184], N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision], N[(-2.0 * N[(c * N[(b * N[(c * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;c \leq -1.25 \cdot 10^{+79}:\\
\;\;\;\;-2 \cdot \left(c \cdot \left(\left(b \cdot c\right) \cdot i\right)\right)\\
\mathbf{elif}\;c \leq 2.7 \cdot 10^{+184}:\\
\;\;\;\;\left(x \cdot y + z \cdot t\right) \cdot 2\\
\mathbf{else}:\\
\;\;\;\;-2 \cdot \left(c \cdot \left(b \cdot \left(c \cdot i\right)\right)\right)\\
\end{array}
\end{array}
if c < -1.25e79Initial program 82.5%
fma-define82.5%
*-commutative82.5%
associate-*l*93.1%
+-commutative93.1%
fma-define93.1%
Simplified93.1%
Taylor expanded in i around inf 86.4%
Taylor expanded in a around 0 82.0%
*-commutative82.0%
Simplified82.0%
if -1.25e79 < c < 2.6999999999999999e184Initial program 95.3%
fma-define95.3%
*-commutative95.3%
associate-*l*90.6%
+-commutative90.6%
fma-define90.6%
Simplified90.6%
Taylor expanded in c around 0 72.5%
if 2.6999999999999999e184 < c Initial program 95.7%
fma-define95.7%
*-commutative95.7%
associate-*l*95.7%
+-commutative95.7%
fma-define95.7%
Simplified95.7%
Taylor expanded in i around inf 83.2%
Taylor expanded in a around 0 70.4%
Final simplification74.0%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= x -6.2e+103) (not (<= x 6.5e-73))) (* x (* y 2.0)) (* t (* z 2.0))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((x <= -6.2e+103) || !(x <= 6.5e-73)) {
tmp = x * (y * 2.0);
} else {
tmp = t * (z * 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 ((x <= (-6.2d+103)) .or. (.not. (x <= 6.5d-73))) then
tmp = x * (y * 2.0d0)
else
tmp = t * (z * 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 ((x <= -6.2e+103) || !(x <= 6.5e-73)) {
tmp = x * (y * 2.0);
} else {
tmp = t * (z * 2.0);
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if (x <= -6.2e+103) or not (x <= 6.5e-73): tmp = x * (y * 2.0) else: tmp = t * (z * 2.0) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if ((x <= -6.2e+103) || !(x <= 6.5e-73)) tmp = Float64(x * Float64(y * 2.0)); else tmp = Float64(t * Float64(z * 2.0)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if ((x <= -6.2e+103) || ~((x <= 6.5e-73))) tmp = x * (y * 2.0); else tmp = t * (z * 2.0); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[x, -6.2e+103], N[Not[LessEqual[x, 6.5e-73]], $MachinePrecision]], N[(x * N[(y * 2.0), $MachinePrecision]), $MachinePrecision], N[(t * N[(z * 2.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -6.2 \cdot 10^{+103} \lor \neg \left(x \leq 6.5 \cdot 10^{-73}\right):\\
\;\;\;\;x \cdot \left(y \cdot 2\right)\\
\mathbf{else}:\\
\;\;\;\;t \cdot \left(z \cdot 2\right)\\
\end{array}
\end{array}
if x < -6.2000000000000003e103 or 6.4999999999999999e-73 < x Initial program 91.1%
fma-define91.1%
*-commutative91.1%
associate-*l*91.8%
+-commutative91.8%
fma-define91.8%
Simplified91.8%
Taylor expanded in x around inf 49.7%
*-commutative49.7%
associate-*l*49.7%
Simplified49.7%
if -6.2000000000000003e103 < x < 6.4999999999999999e-73Initial program 94.9%
fma-define94.9%
*-commutative94.9%
associate-*l*91.2%
+-commutative91.2%
fma-define91.2%
Simplified91.2%
Taylor expanded in z around inf 40.5%
*-commutative40.5%
*-commutative40.5%
*-commutative40.5%
associate-*r*40.5%
Simplified40.5%
Final simplification44.9%
(FPCore (x y z t a b c i) :precision binary64 (* t (* z 2.0)))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return t * (z * 2.0);
}
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 = t * (z * 2.0d0)
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return t * (z * 2.0);
}
def code(x, y, z, t, a, b, c, i): return t * (z * 2.0)
function code(x, y, z, t, a, b, c, i) return Float64(t * Float64(z * 2.0)) end
function tmp = code(x, y, z, t, a, b, c, i) tmp = t * (z * 2.0); end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(t * N[(z * 2.0), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
t \cdot \left(z \cdot 2\right)
\end{array}
Initial program 93.1%
fma-define93.1%
*-commutative93.1%
associate-*l*91.5%
+-commutative91.5%
fma-define91.5%
Simplified91.5%
Taylor expanded in z around inf 31.4%
*-commutative31.4%
*-commutative31.4%
*-commutative31.4%
associate-*r*31.4%
Simplified31.4%
(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 2024157
(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))))