
(FPCore (x y z t a b c i) :precision binary64 (* 2.0 (- (+ (* x y) (* z t)) (* (* (+ a (* b c)) c) i))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return 2.0 * (((x * y) + (z * t)) - (((a + (b * c)) * c) * i));
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
code = 2.0d0 * (((x * y) + (z * t)) - (((a + (b * c)) * c) * i))
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return 2.0 * (((x * y) + (z * t)) - (((a + (b * c)) * c) * i));
}
def code(x, y, z, t, a, b, c, i): return 2.0 * (((x * y) + (z * t)) - (((a + (b * c)) * c) * i))
function code(x, y, z, t, a, b, c, i) return Float64(2.0 * Float64(Float64(Float64(x * y) + Float64(z * t)) - Float64(Float64(Float64(a + Float64(b * c)) * c) * i))) end
function tmp = code(x, y, z, t, a, b, c, i) tmp = 2.0 * (((x * y) + (z * t)) - (((a + (b * c)) * c) * i)); end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(2.0 * N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] - N[(N[(N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision] * c), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
2 \cdot \left(\left(x \cdot y + z \cdot t\right) - \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i\right)
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 15 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a b c i) :precision binary64 (* 2.0 (- (+ (* x y) (* z t)) (* (* (+ a (* b c)) c) i))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return 2.0 * (((x * y) + (z * t)) - (((a + (b * c)) * c) * i));
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
code = 2.0d0 * (((x * y) + (z * t)) - (((a + (b * c)) * c) * i))
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return 2.0 * (((x * y) + (z * t)) - (((a + (b * c)) * c) * i));
}
def code(x, y, z, t, a, b, c, i): return 2.0 * (((x * y) + (z * t)) - (((a + (b * c)) * c) * i))
function code(x, y, z, t, a, b, c, i) return Float64(2.0 * Float64(Float64(Float64(x * y) + Float64(z * t)) - Float64(Float64(Float64(a + Float64(b * c)) * c) * i))) end
function tmp = code(x, y, z, t, a, b, c, i) tmp = 2.0 * (((x * y) + (z * t)) - (((a + (b * c)) * c) * i)); end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(2.0 * N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] - N[(N[(N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision] * c), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
2 \cdot \left(\left(x \cdot y + z \cdot t\right) - \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i\right)
\end{array}
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ a (* b c))))
(if (<= (- (+ (* x y) (* z t)) (* (* c t_1) i)) INFINITY)
(* 2.0 (- (fma x y (* z t)) (* t_1 (* c i))))
(* 2.0 (* 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%
associate--l+92.9%
*-commutative92.9%
associate--l+92.9%
associate--l+92.9%
*-commutative92.9%
associate--l+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 (* (* x y) 2.0)))
(if (<= (* x y) -2.6e+153)
t_1
(if (<= (* x y) -3.35e-9)
(* 2.0 (* z t))
(if (<= (* x y) -2.1e-45)
(* c (* (* a i) -2.0))
(if (<= (* x y) 5e-98)
(* t (* z 2.0))
(if (<= (* x y) 6e+31) (* (* a (* c 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 = (x * y) * 2.0;
double tmp;
if ((x * y) <= -2.6e+153) {
tmp = t_1;
} else if ((x * y) <= -3.35e-9) {
tmp = 2.0 * (z * t);
} else if ((x * y) <= -2.1e-45) {
tmp = c * ((a * i) * -2.0);
} else if ((x * y) <= 5e-98) {
tmp = t * (z * 2.0);
} else if ((x * y) <= 6e+31) {
tmp = (a * (c * i)) * -2.0;
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: t_1
real(8) :: tmp
t_1 = (x * y) * 2.0d0
if ((x * y) <= (-2.6d+153)) then
tmp = t_1
else if ((x * y) <= (-3.35d-9)) then
tmp = 2.0d0 * (z * t)
else if ((x * y) <= (-2.1d-45)) then
tmp = c * ((a * i) * (-2.0d0))
else if ((x * y) <= 5d-98) then
tmp = t * (z * 2.0d0)
else if ((x * y) <= 6d+31) then
tmp = (a * (c * i)) * (-2.0d0)
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = (x * y) * 2.0;
double tmp;
if ((x * y) <= -2.6e+153) {
tmp = t_1;
} else if ((x * y) <= -3.35e-9) {
tmp = 2.0 * (z * t);
} else if ((x * y) <= -2.1e-45) {
tmp = c * ((a * i) * -2.0);
} else if ((x * y) <= 5e-98) {
tmp = t * (z * 2.0);
} else if ((x * y) <= 6e+31) {
tmp = (a * (c * i)) * -2.0;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = (x * y) * 2.0 tmp = 0 if (x * y) <= -2.6e+153: tmp = t_1 elif (x * y) <= -3.35e-9: tmp = 2.0 * (z * t) elif (x * y) <= -2.1e-45: tmp = c * ((a * i) * -2.0) elif (x * y) <= 5e-98: tmp = t * (z * 2.0) elif (x * y) <= 6e+31: tmp = (a * (c * i)) * -2.0 else: tmp = t_1 return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(Float64(x * y) * 2.0) tmp = 0.0 if (Float64(x * y) <= -2.6e+153) tmp = t_1; elseif (Float64(x * y) <= -3.35e-9) tmp = Float64(2.0 * Float64(z * t)); elseif (Float64(x * y) <= -2.1e-45) tmp = Float64(c * Float64(Float64(a * i) * -2.0)); elseif (Float64(x * y) <= 5e-98) tmp = Float64(t * Float64(z * 2.0)); elseif (Float64(x * y) <= 6e+31) tmp = Float64(Float64(a * Float64(c * i)) * -2.0); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = (x * y) * 2.0; tmp = 0.0; if ((x * y) <= -2.6e+153) tmp = t_1; elseif ((x * y) <= -3.35e-9) tmp = 2.0 * (z * t); elseif ((x * y) <= -2.1e-45) tmp = c * ((a * i) * -2.0); elseif ((x * y) <= 5e-98) tmp = t * (z * 2.0); elseif ((x * y) <= 6e+31) tmp = (a * (c * i)) * -2.0; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(x * y), $MachinePrecision] * 2.0), $MachinePrecision]}, If[LessEqual[N[(x * y), $MachinePrecision], -2.6e+153], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], -3.35e-9], N[(2.0 * N[(z * t), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], -2.1e-45], N[(c * N[(N[(a * i), $MachinePrecision] * -2.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 5e-98], N[(t * N[(z * 2.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 6e+31], N[(N[(a * N[(c * i), $MachinePrecision]), $MachinePrecision] * -2.0), $MachinePrecision], t$95$1]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(x \cdot y\right) \cdot 2\\
\mathbf{if}\;x \cdot y \leq -2.6 \cdot 10^{+153}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \cdot y \leq -3.35 \cdot 10^{-9}:\\
\;\;\;\;2 \cdot \left(z \cdot t\right)\\
\mathbf{elif}\;x \cdot y \leq -2.1 \cdot 10^{-45}:\\
\;\;\;\;c \cdot \left(\left(a \cdot i\right) \cdot -2\right)\\
\mathbf{elif}\;x \cdot y \leq 5 \cdot 10^{-98}:\\
\;\;\;\;t \cdot \left(z \cdot 2\right)\\
\mathbf{elif}\;x \cdot y \leq 6 \cdot 10^{+31}:\\
\;\;\;\;\left(a \cdot \left(c \cdot i\right)\right) \cdot -2\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if (*.f64 x y) < -2.5999999999999999e153 or 5.99999999999999978e31 < (*.f64 x y) Initial program 85.3%
Taylor expanded in x around inf 64.9%
if -2.5999999999999999e153 < (*.f64 x y) < -3.34999999999999981e-9Initial program 96.0%
Taylor expanded in z around inf 37.2%
if -3.34999999999999981e-9 < (*.f64 x y) < -2.09999999999999995e-45Initial program 62.3%
Taylor expanded in a around inf 52.5%
mul-1-neg52.5%
*-commutative52.5%
distribute-rgt-neg-in52.5%
Simplified52.5%
Taylor expanded in c around 0 52.5%
*-commutative52.5%
associate-*r*42.5%
*-commutative42.5%
associate-*r*52.7%
metadata-eval52.7%
distribute-rgt-neg-in52.7%
associate-*r*52.7%
distribute-rgt-neg-in52.7%
*-commutative52.7%
distribute-lft-neg-in52.7%
metadata-eval52.7%
Simplified52.7%
if -2.09999999999999995e-45 < (*.f64 x y) < 5.00000000000000018e-98Initial program 90.9%
Taylor expanded in z around inf 44.9%
expm1-log1p-u24.5%
expm1-udef16.3%
*-commutative16.3%
associate-*l*16.3%
Applied egg-rr16.3%
expm1-def24.5%
expm1-log1p44.9%
*-commutative44.9%
Simplified44.9%
if 5.00000000000000018e-98 < (*.f64 x y) < 5.99999999999999978e31Initial program 85.5%
Taylor expanded in a around inf 43.7%
mul-1-neg43.7%
*-commutative43.7%
distribute-rgt-neg-in43.7%
Simplified43.7%
Taylor expanded in c around 0 43.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) -1.95e+153)
t_2
(if (<= (* x y) -2.5e-12)
t_1
(if (<= (* x y) -2.7e-44)
(* c (* (* a i) -2.0))
(if (<= (* x y) 2.95e+69) 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) <= -1.95e+153) {
tmp = t_2;
} else if ((x * y) <= -2.5e-12) {
tmp = t_1;
} else if ((x * y) <= -2.7e-44) {
tmp = c * ((a * i) * -2.0);
} else if ((x * y) <= 2.95e+69) {
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) <= (-1.95d+153)) then
tmp = t_2
else if ((x * y) <= (-2.5d-12)) then
tmp = t_1
else if ((x * y) <= (-2.7d-44)) then
tmp = c * ((a * i) * (-2.0d0))
else if ((x * y) <= 2.95d+69) 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) <= -1.95e+153) {
tmp = t_2;
} else if ((x * y) <= -2.5e-12) {
tmp = t_1;
} else if ((x * y) <= -2.7e-44) {
tmp = c * ((a * i) * -2.0);
} else if ((x * y) <= 2.95e+69) {
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) <= -1.95e+153: tmp = t_2 elif (x * y) <= -2.5e-12: tmp = t_1 elif (x * y) <= -2.7e-44: tmp = c * ((a * i) * -2.0) elif (x * y) <= 2.95e+69: 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) <= -1.95e+153) tmp = t_2; elseif (Float64(x * y) <= -2.5e-12) tmp = t_1; elseif (Float64(x * y) <= -2.7e-44) tmp = Float64(c * Float64(Float64(a * i) * -2.0)); elseif (Float64(x * y) <= 2.95e+69) 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) <= -1.95e+153) tmp = t_2; elseif ((x * y) <= -2.5e-12) tmp = t_1; elseif ((x * y) <= -2.7e-44) tmp = c * ((a * i) * -2.0); elseif ((x * y) <= 2.95e+69) 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], -1.95e+153], t$95$2, If[LessEqual[N[(x * y), $MachinePrecision], -2.5e-12], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], -2.7e-44], N[(c * N[(N[(a * i), $MachinePrecision] * -2.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 2.95e+69], 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 -1.95 \cdot 10^{+153}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;x \cdot y \leq -2.5 \cdot 10^{-12}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \cdot y \leq -2.7 \cdot 10^{-44}:\\
\;\;\;\;c \cdot \left(\left(a \cdot i\right) \cdot -2\right)\\
\mathbf{elif}\;x \cdot y \leq 2.95 \cdot 10^{+69}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if (*.f64 x y) < -1.94999999999999992e153 or 2.95000000000000002e69 < (*.f64 x y) Initial program 83.6%
Taylor expanded in x around inf 68.2%
if -1.94999999999999992e153 < (*.f64 x y) < -2.49999999999999985e-12 or -2.6999999999999999e-44 < (*.f64 x y) < 2.95000000000000002e69Initial program 91.3%
Taylor expanded in z around inf 39.5%
if -2.49999999999999985e-12 < (*.f64 x y) < -2.6999999999999999e-44Initial program 62.3%
Taylor expanded in a around inf 52.5%
mul-1-neg52.5%
*-commutative52.5%
distribute-rgt-neg-in52.5%
Simplified52.5%
Taylor expanded in c around 0 52.5%
*-commutative52.5%
associate-*r*42.5%
*-commutative42.5%
associate-*r*52.7%
metadata-eval52.7%
distribute-rgt-neg-in52.7%
associate-*r*52.7%
distribute-rgt-neg-in52.7%
*-commutative52.7%
distribute-lft-neg-in52.7%
metadata-eval52.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%
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 (<= c -58000000000000.0)
(* 2.0 (* c (* b (* c (- i)))))
(if (<= c 1.26e-23)
(* (+ (* x y) (* z t)) 2.0)
(* 2.0 (- (* z t) (* a (* c i)))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (c <= -58000000000000.0) {
tmp = 2.0 * (c * (b * (c * -i)));
} else if (c <= 1.26e-23) {
tmp = ((x * y) + (z * t)) * 2.0;
} else {
tmp = 2.0 * ((z * t) - (a * (c * i)));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: tmp
if (c <= (-58000000000000.0d0)) then
tmp = 2.0d0 * (c * (b * (c * -i)))
else if (c <= 1.26d-23) then
tmp = ((x * y) + (z * t)) * 2.0d0
else
tmp = 2.0d0 * ((z * t) - (a * (c * i)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (c <= -58000000000000.0) {
tmp = 2.0 * (c * (b * (c * -i)));
} else if (c <= 1.26e-23) {
tmp = ((x * y) + (z * t)) * 2.0;
} else {
tmp = 2.0 * ((z * t) - (a * (c * 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.26e-23: tmp = ((x * y) + (z * t)) * 2.0 else: tmp = 2.0 * ((z * t) - (a * (c * i))) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (c <= -58000000000000.0) tmp = Float64(2.0 * Float64(c * Float64(b * Float64(c * Float64(-i))))); elseif (c <= 1.26e-23) tmp = Float64(Float64(Float64(x * y) + Float64(z * t)) * 2.0); else tmp = Float64(2.0 * Float64(Float64(z * t) - Float64(a * Float64(c * i)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if (c <= -58000000000000.0) tmp = 2.0 * (c * (b * (c * -i))); elseif (c <= 1.26e-23) tmp = ((x * y) + (z * t)) * 2.0; else tmp = 2.0 * ((z * t) - (a * (c * 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.26e-23], N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision], N[(2.0 * N[(N[(z * t), $MachinePrecision] - N[(a * N[(c * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;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.26 \cdot 10^{-23}:\\
\;\;\;\;\left(x \cdot y + z \cdot t\right) \cdot 2\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(z \cdot t - a \cdot \left(c \cdot i\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.25999999999999996e-23Initial program 99.2%
Taylor expanded in c around 0 79.1%
if 1.25999999999999996e-23 < c Initial program 79.9%
Taylor expanded in x around 0 85.1%
Taylor expanded in c around 0 59.3%
+-commutative59.3%
mul-1-neg59.3%
sub-neg59.3%
Simplified59.3%
Final simplification71.7%
(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.45e+37)
(* (+ (* x y) (* z t)) 2.0)
(* (* c (* c (* b i))) (- 2.0)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (c <= -58000000000000.0) {
tmp = 2.0 * (c * (b * (c * -i)));
} else if (c <= 1.45e+37) {
tmp = ((x * y) + (z * t)) * 2.0;
} else {
tmp = (c * (c * (b * i))) * -2.0;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: tmp
if (c <= (-58000000000000.0d0)) then
tmp = 2.0d0 * (c * (b * (c * -i)))
else if (c <= 1.45d+37) then
tmp = ((x * y) + (z * t)) * 2.0d0
else
tmp = (c * (c * (b * i))) * -2.0d0
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (c <= -58000000000000.0) {
tmp = 2.0 * (c * (b * (c * -i)));
} else if (c <= 1.45e+37) {
tmp = ((x * y) + (z * t)) * 2.0;
} else {
tmp = (c * (c * (b * i))) * -2.0;
}
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.45e+37: tmp = ((x * y) + (z * t)) * 2.0 else: tmp = (c * (c * (b * i))) * -2.0 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.45e+37) tmp = Float64(Float64(Float64(x * y) + Float64(z * t)) * 2.0); else tmp = Float64(Float64(c * Float64(c * Float64(b * i))) * Float64(-2.0)); 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.45e+37) tmp = ((x * y) + (z * t)) * 2.0; else tmp = (c * (c * (b * i))) * -2.0; 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.45e+37], N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision], N[(N[(c * N[(c * N[(b * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * (-2.0)), $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.45 \cdot 10^{+37}:\\
\;\;\;\;\left(x \cdot y + z \cdot t\right) \cdot 2\\
\mathbf{else}:\\
\;\;\;\;\left(c \cdot \left(c \cdot \left(b \cdot i\right)\right)\right) \cdot \left(-2\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.44999999999999989e37Initial program 98.6%
Taylor expanded in c around 0 75.7%
if 1.44999999999999989e37 < 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) -4.15e+152) (not (<= (* x y) 3.9e+67))) (* (* 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) <= -4.15e+152) || !((x * y) <= 3.9e+67)) {
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) <= (-4.15d+152)) .or. (.not. ((x * y) <= 3.9d+67))) 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) <= -4.15e+152) || !((x * y) <= 3.9e+67)) {
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) <= -4.15e+152) or not ((x * y) <= 3.9e+67): 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) <= -4.15e+152) || !(Float64(x * y) <= 3.9e+67)) 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) <= -4.15e+152) || ~(((x * y) <= 3.9e+67))) 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], -4.15e+152], N[Not[LessEqual[N[(x * y), $MachinePrecision], 3.9e+67]], $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 -4.15 \cdot 10^{+152} \lor \neg \left(x \cdot y \leq 3.9 \cdot 10^{+67}\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) < -4.1500000000000001e152 or 3.90000000000000007e67 < (*.f64 x y) Initial program 83.6%
Taylor expanded in x around inf 68.2%
if -4.1500000000000001e152 < (*.f64 x y) < 3.90000000000000007e67Initial 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 2.3e+174) (* (+ (* x y) (* z t)) 2.0) (* (* a (* c i)) -2.0)))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (i <= 2.3e+174) {
tmp = ((x * y) + (z * t)) * 2.0;
} else {
tmp = (a * (c * i)) * -2.0;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: tmp
if (i <= 2.3d+174) then
tmp = ((x * y) + (z * t)) * 2.0d0
else
tmp = (a * (c * i)) * (-2.0d0)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (i <= 2.3e+174) {
tmp = ((x * y) + (z * t)) * 2.0;
} else {
tmp = (a * (c * i)) * -2.0;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if i <= 2.3e+174: tmp = ((x * y) + (z * t)) * 2.0 else: tmp = (a * (c * i)) * -2.0 return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (i <= 2.3e+174) tmp = Float64(Float64(Float64(x * y) + Float64(z * t)) * 2.0); else tmp = Float64(Float64(a * Float64(c * i)) * -2.0); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if (i <= 2.3e+174) tmp = ((x * y) + (z * t)) * 2.0; else tmp = (a * (c * i)) * -2.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[i, 2.3e+174], N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision], N[(N[(a * N[(c * i), $MachinePrecision]), $MachinePrecision] * -2.0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;i \leq 2.3 \cdot 10^{+174}:\\
\;\;\;\;\left(x \cdot y + z \cdot t\right) \cdot 2\\
\mathbf{else}:\\
\;\;\;\;\left(a \cdot \left(c \cdot i\right)\right) \cdot -2\\
\end{array}
\end{array}
if i < 2.2999999999999998e174Initial program 89.0%
Taylor expanded in c around 0 59.4%
if 2.2999999999999998e174 < i Initial program 78.3%
Taylor expanded in a around inf 55.0%
mul-1-neg55.0%
*-commutative55.0%
distribute-rgt-neg-in55.0%
Simplified55.0%
Taylor expanded in c around 0 55.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))))