
(FPCore (x y z t a b c i) :precision binary64 (* 2.0 (- (+ (* x y) (* z t)) (* (* (+ a (* b c)) c) i))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return 2.0 * (((x * y) + (z * t)) - (((a + (b * c)) * c) * i));
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
code = 2.0d0 * (((x * y) + (z * t)) - (((a + (b * c)) * c) * i))
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return 2.0 * (((x * y) + (z * t)) - (((a + (b * c)) * c) * i));
}
def code(x, y, z, t, a, b, c, i): return 2.0 * (((x * y) + (z * t)) - (((a + (b * c)) * c) * i))
function code(x, y, z, t, a, b, c, i) return Float64(2.0 * Float64(Float64(Float64(x * y) + Float64(z * t)) - Float64(Float64(Float64(a + Float64(b * c)) * c) * i))) end
function tmp = code(x, y, z, t, a, b, c, i) tmp = 2.0 * (((x * y) + (z * t)) - (((a + (b * c)) * c) * i)); end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(2.0 * N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] - N[(N[(N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision] * c), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
2 \cdot \left(\left(x \cdot y + z \cdot t\right) - \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i\right)
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 14 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a b c i) :precision binary64 (* 2.0 (- (+ (* x y) (* z t)) (* (* (+ a (* b c)) c) i))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return 2.0 * (((x * y) + (z * t)) - (((a + (b * c)) * c) * i));
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
code = 2.0d0 * (((x * y) + (z * t)) - (((a + (b * c)) * c) * i))
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return 2.0 * (((x * y) + (z * t)) - (((a + (b * c)) * c) * i));
}
def code(x, y, z, t, a, b, c, i): return 2.0 * (((x * y) + (z * t)) - (((a + (b * c)) * c) * i))
function code(x, y, z, t, a, b, c, i) return Float64(2.0 * Float64(Float64(Float64(x * y) + Float64(z * t)) - Float64(Float64(Float64(a + Float64(b * c)) * c) * i))) end
function tmp = code(x, y, z, t, a, b, c, i) tmp = 2.0 * (((x * y) + (z * t)) - (((a + (b * c)) * c) * i)); end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(2.0 * N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] - N[(N[(N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision] * c), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
2 \cdot \left(\left(x \cdot y + z \cdot t\right) - \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i\right)
\end{array}
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ a (* b c))))
(if (<= (- (+ (* x y) (* z t)) (* (* c t_1) i)) INFINITY)
(* 2.0 (- (fma x y (* z t)) (* t_1 (* c i))))
(* 2.0 (* c (* b (* c (- i))))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = a + (b * c);
double tmp;
if ((((x * y) + (z * t)) - ((c * t_1) * i)) <= ((double) INFINITY)) {
tmp = 2.0 * (fma(x, y, (z * t)) - (t_1 * (c * i)));
} else {
tmp = 2.0 * (c * (b * (c * -i)));
}
return tmp;
}
function code(x, y, z, t, a, b, c, i) t_1 = Float64(a + Float64(b * c)) tmp = 0.0 if (Float64(Float64(Float64(x * y) + Float64(z * t)) - Float64(Float64(c * t_1) * i)) <= Inf) tmp = Float64(2.0 * Float64(fma(x, y, Float64(z * t)) - Float64(t_1 * Float64(c * i)))); else tmp = Float64(2.0 * Float64(c * Float64(b * Float64(c * Float64(-i))))); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] - N[(N[(c * t$95$1), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision], Infinity], N[(2.0 * N[(N[(x * y + N[(z * t), $MachinePrecision]), $MachinePrecision] - N[(t$95$1 * N[(c * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(c * N[(b * N[(c * (-i)), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a + b \cdot c\\
\mathbf{if}\;\left(x \cdot y + z \cdot t\right) - \left(c \cdot t_1\right) \cdot i \leq \infty:\\
\;\;\;\;2 \cdot \left(\mathsf{fma}\left(x, y, z \cdot t\right) - t_1 \cdot \left(c \cdot i\right)\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(c \cdot \left(b \cdot \left(c \cdot \left(-i\right)\right)\right)\right)\\
\end{array}
\end{array}
if (-.f64 (+.f64 (*.f64 x y) (*.f64 z t)) (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i)) < +inf.0Initial program 92.9%
fma-def92.9%
associate-*l*97.3%
Simplified97.3%
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 i around inf 57.5%
Taylor expanded in a around 0 57.6%
Final simplification95.1%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ a (* b c))) (t_2 (* (* c t_1) i)))
(if (or (<= t_2 -5e+282) (not (<= t_2 1e+307)))
(* 2.0 (* c (* t_1 (- i))))
(* (- (+ (* x y) (* z t)) t_2) 2.0))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = a + (b * c);
double t_2 = (c * t_1) * i;
double tmp;
if ((t_2 <= -5e+282) || !(t_2 <= 1e+307)) {
tmp = 2.0 * (c * (t_1 * -i));
} else {
tmp = (((x * y) + (z * t)) - t_2) * 2.0;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = a + (b * c)
t_2 = (c * t_1) * i
if ((t_2 <= (-5d+282)) .or. (.not. (t_2 <= 1d+307))) then
tmp = 2.0d0 * (c * (t_1 * -i))
else
tmp = (((x * y) + (z * t)) - t_2) * 2.0d0
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = a + (b * c);
double t_2 = (c * t_1) * i;
double tmp;
if ((t_2 <= -5e+282) || !(t_2 <= 1e+307)) {
tmp = 2.0 * (c * (t_1 * -i));
} else {
tmp = (((x * y) + (z * t)) - t_2) * 2.0;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = a + (b * c) t_2 = (c * t_1) * i tmp = 0 if (t_2 <= -5e+282) or not (t_2 <= 1e+307): tmp = 2.0 * (c * (t_1 * -i)) else: tmp = (((x * y) + (z * t)) - t_2) * 2.0 return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(a + Float64(b * c)) t_2 = Float64(Float64(c * t_1) * i) tmp = 0.0 if ((t_2 <= -5e+282) || !(t_2 <= 1e+307)) tmp = Float64(2.0 * Float64(c * Float64(t_1 * Float64(-i)))); else tmp = Float64(Float64(Float64(Float64(x * y) + Float64(z * t)) - t_2) * 2.0); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = a + (b * c); t_2 = (c * t_1) * i; tmp = 0.0; if ((t_2 <= -5e+282) || ~((t_2 <= 1e+307))) tmp = 2.0 * (c * (t_1 * -i)); else tmp = (((x * y) + (z * t)) - t_2) * 2.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(c * t$95$1), $MachinePrecision] * i), $MachinePrecision]}, If[Or[LessEqual[t$95$2, -5e+282], N[Not[LessEqual[t$95$2, 1e+307]], $MachinePrecision]], N[(2.0 * N[(c * N[(t$95$1 * (-i)), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] - t$95$2), $MachinePrecision] * 2.0), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a + b \cdot c\\
t_2 := \left(c \cdot t_1\right) \cdot i\\
\mathbf{if}\;t_2 \leq -5 \cdot 10^{+282} \lor \neg \left(t_2 \leq 10^{+307}\right):\\
\;\;\;\;2 \cdot \left(c \cdot \left(t_1 \cdot \left(-i\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\left(x \cdot y + z \cdot t\right) - t_2\right) \cdot 2\\
\end{array}
\end{array}
if (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < -4.99999999999999978e282 or 9.99999999999999986e306 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) Initial program 67.8%
Taylor expanded in i around inf 87.5%
if -4.99999999999999978e282 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 9.99999999999999986e306Initial program 99.3%
Final simplification95.0%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* 2.0 (* z t))) (t_2 (* (* x y) 2.0)))
(if (<= (* x y) -4.15e+152)
t_2
(if (<= (* x y) -6e-12)
t_1
(if (<= (* x y) -1.5e-47)
(* (* c (* a i)) -2.0)
(if (<= (* x y) 4.8e-98)
t_1
(if (<= (* x y) 1.55e+31) (* (* c i) (* a -2.0)) 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 = (x * y) * 2.0;
double tmp;
if ((x * y) <= -4.15e+152) {
tmp = t_2;
} else if ((x * y) <= -6e-12) {
tmp = t_1;
} else if ((x * y) <= -1.5e-47) {
tmp = (c * (a * i)) * -2.0;
} else if ((x * y) <= 4.8e-98) {
tmp = t_1;
} else if ((x * y) <= 1.55e+31) {
tmp = (c * i) * (a * -2.0);
} 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 = (x * y) * 2.0d0
if ((x * y) <= (-4.15d+152)) then
tmp = t_2
else if ((x * y) <= (-6d-12)) then
tmp = t_1
else if ((x * y) <= (-1.5d-47)) then
tmp = (c * (a * i)) * (-2.0d0)
else if ((x * y) <= 4.8d-98) then
tmp = t_1
else if ((x * y) <= 1.55d+31) then
tmp = (c * i) * (a * (-2.0d0))
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 = (x * y) * 2.0;
double tmp;
if ((x * y) <= -4.15e+152) {
tmp = t_2;
} else if ((x * y) <= -6e-12) {
tmp = t_1;
} else if ((x * y) <= -1.5e-47) {
tmp = (c * (a * i)) * -2.0;
} else if ((x * y) <= 4.8e-98) {
tmp = t_1;
} else if ((x * y) <= 1.55e+31) {
tmp = (c * i) * (a * -2.0);
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = 2.0 * (z * t) t_2 = (x * y) * 2.0 tmp = 0 if (x * y) <= -4.15e+152: tmp = t_2 elif (x * y) <= -6e-12: tmp = t_1 elif (x * y) <= -1.5e-47: tmp = (c * (a * i)) * -2.0 elif (x * y) <= 4.8e-98: tmp = t_1 elif (x * y) <= 1.55e+31: tmp = (c * i) * (a * -2.0) 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(Float64(x * y) * 2.0) tmp = 0.0 if (Float64(x * y) <= -4.15e+152) tmp = t_2; elseif (Float64(x * y) <= -6e-12) tmp = t_1; elseif (Float64(x * y) <= -1.5e-47) tmp = Float64(Float64(c * Float64(a * i)) * -2.0); elseif (Float64(x * y) <= 4.8e-98) tmp = t_1; elseif (Float64(x * y) <= 1.55e+31) tmp = Float64(Float64(c * i) * Float64(a * -2.0)); 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 = (x * y) * 2.0; tmp = 0.0; if ((x * y) <= -4.15e+152) tmp = t_2; elseif ((x * y) <= -6e-12) tmp = t_1; elseif ((x * y) <= -1.5e-47) tmp = (c * (a * i)) * -2.0; elseif ((x * y) <= 4.8e-98) tmp = t_1; elseif ((x * y) <= 1.55e+31) tmp = (c * i) * (a * -2.0); 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[(N[(x * y), $MachinePrecision] * 2.0), $MachinePrecision]}, If[LessEqual[N[(x * y), $MachinePrecision], -4.15e+152], t$95$2, If[LessEqual[N[(x * y), $MachinePrecision], -6e-12], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], -1.5e-47], N[(N[(c * N[(a * i), $MachinePrecision]), $MachinePrecision] * -2.0), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 4.8e-98], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], 1.55e+31], N[(N[(c * i), $MachinePrecision] * N[(a * -2.0), $MachinePrecision]), $MachinePrecision], t$95$2]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := 2 \cdot \left(z \cdot t\right)\\
t_2 := \left(x \cdot y\right) \cdot 2\\
\mathbf{if}\;x \cdot y \leq -4.15 \cdot 10^{+152}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;x \cdot y \leq -6 \cdot 10^{-12}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \cdot y \leq -1.5 \cdot 10^{-47}:\\
\;\;\;\;\left(c \cdot \left(a \cdot i\right)\right) \cdot -2\\
\mathbf{elif}\;x \cdot y \leq 4.8 \cdot 10^{-98}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \cdot y \leq 1.55 \cdot 10^{+31}:\\
\;\;\;\;\left(c \cdot i\right) \cdot \left(a \cdot -2\right)\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if (*.f64 x y) < -4.1500000000000001e152 or 1.5500000000000001e31 < (*.f64 x y) Initial program 85.3%
Taylor expanded in x around inf 64.9%
if -4.1500000000000001e152 < (*.f64 x y) < -6.0000000000000003e-12 or -1.50000000000000008e-47 < (*.f64 x y) < 4.8000000000000001e-98Initial program 91.9%
Taylor expanded in z around inf 43.4%
if -6.0000000000000003e-12 < (*.f64 x y) < -1.50000000000000008e-47Initial program 62.3%
Taylor expanded in a around inf 52.5%
mul-1-neg52.5%
distribute-rgt-neg-in52.5%
*-commutative52.5%
distribute-rgt-neg-in52.5%
Simplified52.5%
Taylor expanded in a around 0 52.5%
associate-*r*42.5%
*-commutative42.5%
*-commutative42.5%
*-commutative42.5%
Simplified42.5%
Taylor expanded in i around 0 52.5%
*-commutative52.5%
associate-*r*52.7%
Simplified52.7%
if 4.8000000000000001e-98 < (*.f64 x y) < 1.5500000000000001e31Initial program 85.5%
Taylor expanded in a around inf 43.7%
mul-1-neg43.7%
distribute-rgt-neg-in43.7%
*-commutative43.7%
distribute-rgt-neg-in43.7%
Simplified43.7%
Taylor expanded in a around 0 43.7%
associate-*r*43.7%
*-commutative43.7%
*-commutative43.7%
Simplified43.7%
Final simplification51.2%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* 2.0 (* z t))) (t_2 (* (* x y) 2.0)))
(if (<= (* x y) -8.5e+152)
t_2
(if (<= (* x y) -4.5e-12)
t_1
(if (<= (* x y) -1.75e-43)
(* (* c (* a i)) -2.0)
(if (<= (* x y) 4.5e+70) 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 = (x * y) * 2.0;
double tmp;
if ((x * y) <= -8.5e+152) {
tmp = t_2;
} else if ((x * y) <= -4.5e-12) {
tmp = t_1;
} else if ((x * y) <= -1.75e-43) {
tmp = (c * (a * i)) * -2.0;
} else if ((x * y) <= 4.5e+70) {
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 = (x * y) * 2.0d0
if ((x * y) <= (-8.5d+152)) then
tmp = t_2
else if ((x * y) <= (-4.5d-12)) then
tmp = t_1
else if ((x * y) <= (-1.75d-43)) then
tmp = (c * (a * i)) * (-2.0d0)
else if ((x * y) <= 4.5d+70) 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 = (x * y) * 2.0;
double tmp;
if ((x * y) <= -8.5e+152) {
tmp = t_2;
} else if ((x * y) <= -4.5e-12) {
tmp = t_1;
} else if ((x * y) <= -1.75e-43) {
tmp = (c * (a * i)) * -2.0;
} else if ((x * y) <= 4.5e+70) {
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 = (x * y) * 2.0 tmp = 0 if (x * y) <= -8.5e+152: tmp = t_2 elif (x * y) <= -4.5e-12: tmp = t_1 elif (x * y) <= -1.75e-43: tmp = (c * (a * i)) * -2.0 elif (x * y) <= 4.5e+70: 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(Float64(x * y) * 2.0) tmp = 0.0 if (Float64(x * y) <= -8.5e+152) tmp = t_2; elseif (Float64(x * y) <= -4.5e-12) tmp = t_1; elseif (Float64(x * y) <= -1.75e-43) tmp = Float64(Float64(c * Float64(a * i)) * -2.0); elseif (Float64(x * y) <= 4.5e+70) 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 = (x * y) * 2.0; tmp = 0.0; if ((x * y) <= -8.5e+152) tmp = t_2; elseif ((x * y) <= -4.5e-12) tmp = t_1; elseif ((x * y) <= -1.75e-43) tmp = (c * (a * i)) * -2.0; elseif ((x * y) <= 4.5e+70) 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[(N[(x * y), $MachinePrecision] * 2.0), $MachinePrecision]}, If[LessEqual[N[(x * y), $MachinePrecision], -8.5e+152], t$95$2, If[LessEqual[N[(x * y), $MachinePrecision], -4.5e-12], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], -1.75e-43], N[(N[(c * N[(a * i), $MachinePrecision]), $MachinePrecision] * -2.0), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 4.5e+70], t$95$1, t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := 2 \cdot \left(z \cdot t\right)\\
t_2 := \left(x \cdot y\right) \cdot 2\\
\mathbf{if}\;x \cdot y \leq -8.5 \cdot 10^{+152}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;x \cdot y \leq -4.5 \cdot 10^{-12}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \cdot y \leq -1.75 \cdot 10^{-43}:\\
\;\;\;\;\left(c \cdot \left(a \cdot i\right)\right) \cdot -2\\
\mathbf{elif}\;x \cdot y \leq 4.5 \cdot 10^{+70}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if (*.f64 x y) < -8.4999999999999993e152 or 4.4999999999999999e70 < (*.f64 x y) Initial program 83.6%
Taylor expanded in x around inf 68.2%
if -8.4999999999999993e152 < (*.f64 x y) < -4.49999999999999981e-12 or -1.74999999999999999e-43 < (*.f64 x y) < 4.4999999999999999e70Initial program 91.3%
Taylor expanded in z around inf 39.5%
if -4.49999999999999981e-12 < (*.f64 x y) < -1.74999999999999999e-43Initial program 62.3%
Taylor expanded in a around inf 52.5%
mul-1-neg52.5%
distribute-rgt-neg-in52.5%
*-commutative52.5%
distribute-rgt-neg-in52.5%
Simplified52.5%
Taylor expanded in a around 0 52.5%
associate-*r*42.5%
*-commutative42.5%
*-commutative42.5%
*-commutative42.5%
Simplified42.5%
Taylor expanded in i around 0 52.5%
*-commutative52.5%
associate-*r*52.7%
Simplified52.7%
Final simplification48.9%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* 2.0 (* c (* (+ a (* b c)) (- i))))))
(if (<= c -7.2e+109)
t_1
(if (<= c -1.25e+14)
(* 2.0 (- (* z t) (* c (* c (* b i)))))
(if (<= c -3e-18)
(* 2.0 (- (* x y) (* c (* a i))))
(if (<= c 6.8e-17) (* (+ (* x y) (* z t)) 2.0) t_1))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = 2.0 * (c * ((a + (b * c)) * -i));
double tmp;
if (c <= -7.2e+109) {
tmp = t_1;
} else if (c <= -1.25e+14) {
tmp = 2.0 * ((z * t) - (c * (c * (b * i))));
} else if (c <= -3e-18) {
tmp = 2.0 * ((x * y) - (c * (a * i)));
} else if (c <= 6.8e-17) {
tmp = ((x * y) + (z * t)) * 2.0;
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: t_1
real(8) :: tmp
t_1 = 2.0d0 * (c * ((a + (b * c)) * -i))
if (c <= (-7.2d+109)) then
tmp = t_1
else if (c <= (-1.25d+14)) then
tmp = 2.0d0 * ((z * t) - (c * (c * (b * i))))
else if (c <= (-3d-18)) then
tmp = 2.0d0 * ((x * y) - (c * (a * i)))
else if (c <= 6.8d-17) then
tmp = ((x * y) + (z * t)) * 2.0d0
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = 2.0 * (c * ((a + (b * c)) * -i));
double tmp;
if (c <= -7.2e+109) {
tmp = t_1;
} else if (c <= -1.25e+14) {
tmp = 2.0 * ((z * t) - (c * (c * (b * i))));
} else if (c <= -3e-18) {
tmp = 2.0 * ((x * y) - (c * (a * i)));
} else if (c <= 6.8e-17) {
tmp = ((x * y) + (z * t)) * 2.0;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = 2.0 * (c * ((a + (b * c)) * -i)) tmp = 0 if c <= -7.2e+109: tmp = t_1 elif c <= -1.25e+14: tmp = 2.0 * ((z * t) - (c * (c * (b * i)))) elif c <= -3e-18: tmp = 2.0 * ((x * y) - (c * (a * i))) elif c <= 6.8e-17: tmp = ((x * y) + (z * t)) * 2.0 else: tmp = t_1 return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(2.0 * Float64(c * Float64(Float64(a + Float64(b * c)) * Float64(-i)))) tmp = 0.0 if (c <= -7.2e+109) tmp = t_1; elseif (c <= -1.25e+14) tmp = Float64(2.0 * Float64(Float64(z * t) - Float64(c * Float64(c * Float64(b * i))))); elseif (c <= -3e-18) tmp = Float64(2.0 * Float64(Float64(x * y) - Float64(c * Float64(a * i)))); elseif (c <= 6.8e-17) tmp = Float64(Float64(Float64(x * y) + Float64(z * t)) * 2.0); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = 2.0 * (c * ((a + (b * c)) * -i)); tmp = 0.0; if (c <= -7.2e+109) tmp = t_1; elseif (c <= -1.25e+14) tmp = 2.0 * ((z * t) - (c * (c * (b * i)))); elseif (c <= -3e-18) tmp = 2.0 * ((x * y) - (c * (a * i))); elseif (c <= 6.8e-17) tmp = ((x * y) + (z * t)) * 2.0; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(2.0 * N[(c * N[(N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision] * (-i)), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[c, -7.2e+109], t$95$1, If[LessEqual[c, -1.25e+14], N[(2.0 * N[(N[(z * t), $MachinePrecision] - N[(c * N[(c * N[(b * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[c, -3e-18], N[(2.0 * N[(N[(x * y), $MachinePrecision] - N[(c * N[(a * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[c, 6.8e-17], N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := 2 \cdot \left(c \cdot \left(\left(a + b \cdot c\right) \cdot \left(-i\right)\right)\right)\\
\mathbf{if}\;c \leq -7.2 \cdot 10^{+109}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;c \leq -1.25 \cdot 10^{+14}:\\
\;\;\;\;2 \cdot \left(z \cdot t - c \cdot \left(c \cdot \left(b \cdot i\right)\right)\right)\\
\mathbf{elif}\;c \leq -3 \cdot 10^{-18}:\\
\;\;\;\;2 \cdot \left(x \cdot y - c \cdot \left(a \cdot i\right)\right)\\
\mathbf{elif}\;c \leq 6.8 \cdot 10^{-17}:\\
\;\;\;\;\left(x \cdot y + z \cdot t\right) \cdot 2\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if c < -7.2e109 or 6.7999999999999996e-17 < c Initial program 73.1%
Taylor expanded in i around inf 79.0%
if -7.2e109 < c < -1.25e14Initial program 79.1%
Taylor expanded in x around 0 91.5%
Taylor expanded in a around 0 81.4%
associate-*r*59.1%
*-commutative59.1%
associate-*r*59.1%
*-commutative59.1%
Simplified85.3%
if -1.25e14 < c < -2.99999999999999983e-18Initial program 100.0%
Taylor expanded in a around inf 100.0%
*-commutative100.0%
associate-*l*100.0%
Simplified100.0%
Taylor expanded in z around 0 100.0%
*-commutative100.0%
associate-*r*100.0%
Simplified100.0%
if -2.99999999999999983e-18 < c < 6.7999999999999996e-17Initial program 99.2%
Taylor expanded in c around 0 79.1%
Final simplification79.9%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= c -3e-131) (not (<= c 2.06e-26))) (* 2.0 (- (* z t) (* c (* (+ a (* b c)) i)))) (* (+ (* x y) (* z t)) 2.0)))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((c <= -3e-131) || !(c <= 2.06e-26)) {
tmp = 2.0 * ((z * t) - (c * ((a + (b * c)) * i)));
} else {
tmp = ((x * y) + (z * t)) * 2.0;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: tmp
if ((c <= (-3d-131)) .or. (.not. (c <= 2.06d-26))) then
tmp = 2.0d0 * ((z * t) - (c * ((a + (b * c)) * i)))
else
tmp = ((x * y) + (z * t)) * 2.0d0
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((c <= -3e-131) || !(c <= 2.06e-26)) {
tmp = 2.0 * ((z * t) - (c * ((a + (b * c)) * i)));
} else {
tmp = ((x * y) + (z * t)) * 2.0;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if (c <= -3e-131) or not (c <= 2.06e-26): tmp = 2.0 * ((z * t) - (c * ((a + (b * c)) * i))) else: tmp = ((x * y) + (z * t)) * 2.0 return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if ((c <= -3e-131) || !(c <= 2.06e-26)) tmp = Float64(2.0 * Float64(Float64(z * t) - Float64(c * Float64(Float64(a + Float64(b * c)) * i)))); else tmp = Float64(Float64(Float64(x * y) + Float64(z * t)) * 2.0); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if ((c <= -3e-131) || ~((c <= 2.06e-26))) tmp = 2.0 * ((z * t) - (c * ((a + (b * c)) * i))); else tmp = ((x * y) + (z * t)) * 2.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[c, -3e-131], N[Not[LessEqual[c, 2.06e-26]], $MachinePrecision]], N[(2.0 * N[(N[(z * t), $MachinePrecision] - N[(c * N[(N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;c \leq -3 \cdot 10^{-131} \lor \neg \left(c \leq 2.06 \cdot 10^{-26}\right):\\
\;\;\;\;2 \cdot \left(z \cdot t - c \cdot \left(\left(a + b \cdot c\right) \cdot i\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(x \cdot y + z \cdot t\right) \cdot 2\\
\end{array}
\end{array}
if c < -2.99999999999999996e-131 or 2.0599999999999999e-26 < c Initial program 81.6%
Taylor expanded in x around 0 82.5%
if -2.99999999999999996e-131 < c < 2.0599999999999999e-26Initial program 98.8%
Taylor expanded in c around 0 84.3%
Final simplification83.2%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= c -1.2e+14) (not (<= c 9e-25))) (* 2.0 (- (* z t) (* 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.2e+14) || !(c <= 9e-25)) {
tmp = 2.0 * ((z * t) - (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.2d+14)) .or. (.not. (c <= 9d-25))) then
tmp = 2.0d0 * ((z * t) - (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.2e+14) || !(c <= 9e-25)) {
tmp = 2.0 * ((z * t) - (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.2e+14) or not (c <= 9e-25): tmp = 2.0 * ((z * t) - (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.2e+14) || !(c <= 9e-25)) tmp = Float64(2.0 * Float64(Float64(z * t) - Float64(c * Float64(Float64(a + Float64(b * c)) * i)))); else tmp = Float64(2.0 * Float64(Float64(Float64(x * y) + 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.2e+14) || ~((c <= 9e-25))) tmp = 2.0 * ((z * t) - (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.2e+14], N[Not[LessEqual[c, 9e-25]], $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[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] - N[(c * N[(a * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;c \leq -1.2 \cdot 10^{+14} \lor \neg \left(c \leq 9 \cdot 10^{-25}\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(\left(x \cdot y + z \cdot t\right) - c \cdot \left(a \cdot i\right)\right)\\
\end{array}
\end{array}
if c < -1.2e14 or 9.0000000000000002e-25 < c Initial program 75.9%
Taylor expanded in x around 0 85.0%
if -1.2e14 < c < 9.0000000000000002e-25Initial program 99.2%
Taylor expanded in a around inf 93.5%
*-commutative93.5%
associate-*l*87.4%
Simplified87.4%
Final simplification86.2%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= c -68000000000000.0) (not (<= c 3.2e-24))) (* 2.0 (- (* z t) (* c (* (+ a (* b c)) i)))) (* 2.0 (- (+ (* x y) (* z t)) (* i (* a c))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((c <= -68000000000000.0) || !(c <= 3.2e-24)) {
tmp = 2.0 * ((z * t) - (c * ((a + (b * c)) * i)));
} else {
tmp = 2.0 * (((x * y) + (z * t)) - (i * (a * c)));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: tmp
if ((c <= (-68000000000000.0d0)) .or. (.not. (c <= 3.2d-24))) then
tmp = 2.0d0 * ((z * t) - (c * ((a + (b * c)) * i)))
else
tmp = 2.0d0 * (((x * y) + (z * t)) - (i * (a * c)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((c <= -68000000000000.0) || !(c <= 3.2e-24)) {
tmp = 2.0 * ((z * t) - (c * ((a + (b * c)) * i)));
} else {
tmp = 2.0 * (((x * y) + (z * t)) - (i * (a * c)));
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if (c <= -68000000000000.0) or not (c <= 3.2e-24): tmp = 2.0 * ((z * t) - (c * ((a + (b * c)) * i))) else: tmp = 2.0 * (((x * y) + (z * t)) - (i * (a * c))) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if ((c <= -68000000000000.0) || !(c <= 3.2e-24)) tmp = Float64(2.0 * Float64(Float64(z * t) - Float64(c * Float64(Float64(a + Float64(b * c)) * i)))); else tmp = Float64(2.0 * Float64(Float64(Float64(x * y) + Float64(z * t)) - Float64(i * Float64(a * c)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if ((c <= -68000000000000.0) || ~((c <= 3.2e-24))) tmp = 2.0 * ((z * t) - (c * ((a + (b * c)) * i))); else tmp = 2.0 * (((x * y) + (z * t)) - (i * (a * c))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[c, -68000000000000.0], N[Not[LessEqual[c, 3.2e-24]], $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[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] - N[(i * N[(a * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;c \leq -68000000000000 \lor \neg \left(c \leq 3.2 \cdot 10^{-24}\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(\left(x \cdot y + z \cdot t\right) - i \cdot \left(a \cdot c\right)\right)\\
\end{array}
\end{array}
if c < -6.8e13 or 3.20000000000000012e-24 < c Initial program 75.9%
Taylor expanded in x around 0 85.0%
if -6.8e13 < c < 3.20000000000000012e-24Initial program 99.2%
Taylor expanded in a around inf 94.0%
*-commutative94.0%
Simplified94.0%
Final simplification89.6%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= c -54000000000000.0) (not (<= c 1.04e-16))) (* 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 <= -54000000000000.0) || !(c <= 1.04e-16)) {
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 <= (-54000000000000.0d0)) .or. (.not. (c <= 1.04d-16))) 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 <= -54000000000000.0) || !(c <= 1.04e-16)) {
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 <= -54000000000000.0) or not (c <= 1.04e-16): 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 <= -54000000000000.0) || !(c <= 1.04e-16)) tmp = Float64(2.0 * Float64(c * Float64(Float64(a + Float64(b * c)) * Float64(-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 <= -54000000000000.0) || ~((c <= 1.04e-16))) 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, -54000000000000.0], N[Not[LessEqual[c, 1.04e-16]], $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 -54000000000000 \lor \neg \left(c \leq 1.04 \cdot 10^{-16}\right):\\
\;\;\;\;2 \cdot \left(c \cdot \left(\left(a + b \cdot c\right) \cdot \left(-i\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(x \cdot y + z \cdot t\right) \cdot 2\\
\end{array}
\end{array}
if c < -5.4e13 or 1.04000000000000001e-16 < c Initial program 74.5%
Taylor expanded in i around inf 76.9%
if -5.4e13 < c < 1.04000000000000001e-16Initial program 99.2%
Taylor expanded in c around 0 78.7%
Final simplification77.9%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= c -65000000000000.0) (not (<= c 2.15e+155))) (* 2.0 (* c (* b (* c (- i))))) (* (+ (* x y) (* z t)) 2.0)))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((c <= -65000000000000.0) || !(c <= 2.15e+155)) {
tmp = 2.0 * (c * (b * (c * -i)));
} else {
tmp = ((x * y) + (z * t)) * 2.0;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: tmp
if ((c <= (-65000000000000.0d0)) .or. (.not. (c <= 2.15d+155))) then
tmp = 2.0d0 * (c * (b * (c * -i)))
else
tmp = ((x * y) + (z * t)) * 2.0d0
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((c <= -65000000000000.0) || !(c <= 2.15e+155)) {
tmp = 2.0 * (c * (b * (c * -i)));
} else {
tmp = ((x * y) + (z * t)) * 2.0;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if (c <= -65000000000000.0) or not (c <= 2.15e+155): tmp = 2.0 * (c * (b * (c * -i))) else: tmp = ((x * y) + (z * t)) * 2.0 return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if ((c <= -65000000000000.0) || !(c <= 2.15e+155)) tmp = Float64(2.0 * Float64(c * Float64(b * Float64(c * Float64(-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 <= -65000000000000.0) || ~((c <= 2.15e+155))) tmp = 2.0 * (c * (b * (c * -i))); else tmp = ((x * y) + (z * t)) * 2.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[c, -65000000000000.0], N[Not[LessEqual[c, 2.15e+155]], $MachinePrecision]], N[(2.0 * N[(c * N[(b * N[(c * (-i)), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;c \leq -65000000000000 \lor \neg \left(c \leq 2.15 \cdot 10^{+155}\right):\\
\;\;\;\;2 \cdot \left(c \cdot \left(b \cdot \left(c \cdot \left(-i\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(x \cdot y + z \cdot t\right) \cdot 2\\
\end{array}
\end{array}
if c < -6.5e13 or 2.1500000000000001e155 < c Initial program 72.4%
Taylor expanded in i around inf 80.8%
Taylor expanded in a around 0 69.8%
if -6.5e13 < c < 2.1500000000000001e155Initial program 96.3%
Taylor expanded in c around 0 72.0%
Final simplification71.3%
(FPCore (x y z t a b c i)
:precision binary64
(if (<= c -58000000000000.0)
(* 2.0 (* c (* b (* c (- i)))))
(if (<= c 1.3e+38)
(* (+ (* x y) (* z t)) 2.0)
(* 2.0 (* c (* c (* b (- i))))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (c <= -58000000000000.0) {
tmp = 2.0 * (c * (b * (c * -i)));
} else if (c <= 1.3e+38) {
tmp = ((x * y) + (z * t)) * 2.0;
} else {
tmp = 2.0 * (c * (c * (b * -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 <= (-58000000000000.0d0)) then
tmp = 2.0d0 * (c * (b * (c * -i)))
else if (c <= 1.3d+38) then
tmp = ((x * y) + (z * t)) * 2.0d0
else
tmp = 2.0d0 * (c * (c * (b * -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 <= -58000000000000.0) {
tmp = 2.0 * (c * (b * (c * -i)));
} else if (c <= 1.3e+38) {
tmp = ((x * y) + (z * t)) * 2.0;
} else {
tmp = 2.0 * (c * (c * (b * -i)));
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if c <= -58000000000000.0: tmp = 2.0 * (c * (b * (c * -i))) elif c <= 1.3e+38: tmp = ((x * y) + (z * t)) * 2.0 else: tmp = 2.0 * (c * (c * (b * -i))) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (c <= -58000000000000.0) tmp = Float64(2.0 * Float64(c * Float64(b * Float64(c * Float64(-i))))); elseif (c <= 1.3e+38) tmp = Float64(Float64(Float64(x * y) + Float64(z * t)) * 2.0); else tmp = Float64(2.0 * Float64(c * Float64(c * Float64(b * Float64(-i))))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if (c <= -58000000000000.0) tmp = 2.0 * (c * (b * (c * -i))); elseif (c <= 1.3e+38) tmp = ((x * y) + (z * t)) * 2.0; else tmp = 2.0 * (c * (c * (b * -i))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[c, -58000000000000.0], N[(2.0 * N[(c * N[(b * N[(c * (-i)), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[c, 1.3e+38], N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision], N[(2.0 * N[(c * N[(c * N[(b * (-i)), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;c \leq -58000000000000:\\
\;\;\;\;2 \cdot \left(c \cdot \left(b \cdot \left(c \cdot \left(-i\right)\right)\right)\right)\\
\mathbf{elif}\;c \leq 1.3 \cdot 10^{+38}:\\
\;\;\;\;\left(x \cdot y + z \cdot t\right) \cdot 2\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(c \cdot \left(c \cdot \left(b \cdot \left(-i\right)\right)\right)\right)\\
\end{array}
\end{array}
if c < -5.8e13Initial program 73.0%
Taylor expanded in i around inf 77.1%
Taylor expanded in a around 0 67.5%
if -5.8e13 < c < 1.3e38Initial program 98.6%
Taylor expanded in c around 0 75.7%
if 1.3e38 < c Initial program 72.6%
Taylor expanded in i around inf 83.4%
Taylor expanded in a around 0 58.1%
associate-*r*58.4%
*-commutative58.4%
associate-*r*60.8%
*-commutative60.8%
Simplified60.8%
Final simplification71.3%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= (* x y) -6.2e+152) (not (<= (* x y) 3.4e+69))) (* (* x y) 2.0) (* 2.0 (* z t))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (((x * y) <= -6.2e+152) || !((x * y) <= 3.4e+69)) {
tmp = (x * y) * 2.0;
} else {
tmp = 2.0 * (z * t);
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: tmp
if (((x * y) <= (-6.2d+152)) .or. (.not. ((x * y) <= 3.4d+69))) then
tmp = (x * y) * 2.0d0
else
tmp = 2.0d0 * (z * t)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (((x * y) <= -6.2e+152) || !((x * y) <= 3.4e+69)) {
tmp = (x * y) * 2.0;
} else {
tmp = 2.0 * (z * t);
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if ((x * y) <= -6.2e+152) or not ((x * y) <= 3.4e+69): tmp = (x * y) * 2.0 else: tmp = 2.0 * (z * t) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if ((Float64(x * y) <= -6.2e+152) || !(Float64(x * y) <= 3.4e+69)) tmp = Float64(Float64(x * y) * 2.0); else tmp = Float64(2.0 * Float64(z * t)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if (((x * y) <= -6.2e+152) || ~(((x * y) <= 3.4e+69))) tmp = (x * y) * 2.0; else tmp = 2.0 * (z * t); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[N[(x * y), $MachinePrecision], -6.2e+152], N[Not[LessEqual[N[(x * y), $MachinePrecision], 3.4e+69]], $MachinePrecision]], N[(N[(x * y), $MachinePrecision] * 2.0), $MachinePrecision], N[(2.0 * N[(z * t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \cdot y \leq -6.2 \cdot 10^{+152} \lor \neg \left(x \cdot y \leq 3.4 \cdot 10^{+69}\right):\\
\;\;\;\;\left(x \cdot y\right) \cdot 2\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(z \cdot t\right)\\
\end{array}
\end{array}
if (*.f64 x y) < -6.2e152 or 3.39999999999999986e69 < (*.f64 x y) Initial program 83.6%
Taylor expanded in x around inf 68.2%
if -6.2e152 < (*.f64 x y) < 3.39999999999999986e69Initial program 89.7%
Taylor expanded in z around inf 37.9%
Final simplification47.2%
(FPCore (x y z t a b c i) :precision binary64 (if (<= i 4.9e+175) (* (+ (* x y) (* z t)) 2.0) (* (* 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 (i <= 4.9e+175) {
tmp = ((x * y) + (z * t)) * 2.0;
} 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 (i <= 4.9d+175) then
tmp = ((x * y) + (z * t)) * 2.0d0
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 (i <= 4.9e+175) {
tmp = ((x * y) + (z * t)) * 2.0;
} else {
tmp = (c * i) * (a * -2.0);
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if i <= 4.9e+175: tmp = ((x * y) + (z * t)) * 2.0 else: tmp = (c * i) * (a * -2.0) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (i <= 4.9e+175) tmp = Float64(Float64(Float64(x * y) + Float64(z * t)) * 2.0); 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 (i <= 4.9e+175) tmp = ((x * y) + (z * t)) * 2.0; else tmp = (c * i) * (a * -2.0); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[i, 4.9e+175], N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision], N[(N[(c * i), $MachinePrecision] * N[(a * -2.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;i \leq 4.9 \cdot 10^{+175}:\\
\;\;\;\;\left(x \cdot y + z \cdot t\right) \cdot 2\\
\mathbf{else}:\\
\;\;\;\;\left(c \cdot i\right) \cdot \left(a \cdot -2\right)\\
\end{array}
\end{array}
if i < 4.90000000000000001e175Initial program 89.0%
Taylor expanded in c around 0 59.4%
if 4.90000000000000001e175 < i Initial program 78.3%
Taylor expanded in a around inf 55.0%
mul-1-neg55.0%
distribute-rgt-neg-in55.0%
*-commutative55.0%
distribute-rgt-neg-in55.0%
Simplified55.0%
Taylor expanded in a around 0 55.0%
associate-*r*55.0%
*-commutative55.0%
*-commutative55.0%
Simplified55.0%
Final simplification59.0%
(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 87.8%
Taylor expanded in z around inf 31.3%
Final simplification31.3%
(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 2024019
(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))))