
(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 (* 2.0 (- (fma x y (* z t)) (* (+ a (* b c)) (* c i)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return 2.0 * (fma(x, y, (z * t)) - ((a + (b * c)) * (c * i)));
}
function code(x, y, z, t, a, b, c, i) return Float64(2.0 * Float64(fma(x, y, Float64(z * t)) - Float64(Float64(a + Float64(b * c)) * Float64(c * i)))) end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(2.0 * N[(N[(x * y + N[(z * t), $MachinePrecision]), $MachinePrecision] - N[(N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision] * N[(c * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
2 \cdot \left(\mathsf{fma}\left(x, y, z \cdot t\right) - \left(a + b \cdot c\right) \cdot \left(c \cdot i\right)\right)
\end{array}
Initial program 92.7%
fma-def92.8%
associate-*l*97.9%
Simplified97.9%
Final simplification97.9%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* 2.0 (* z t)))
(t_2 (* 2.0 (* c (* a (- i)))))
(t_3 (* 2.0 (* x y))))
(if (<= (* x y) -5.5e+122)
t_3
(if (<= (* x y) -1.7e-59)
t_1
(if (<= (* x y) -2.5e-149)
t_2
(if (<= (* x y) 8e-127) t_1 (if (<= (* x y) 4.6e+101) t_2 t_3)))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = 2.0 * (z * t);
double t_2 = 2.0 * (c * (a * -i));
double t_3 = 2.0 * (x * y);
double tmp;
if ((x * y) <= -5.5e+122) {
tmp = t_3;
} else if ((x * y) <= -1.7e-59) {
tmp = t_1;
} else if ((x * y) <= -2.5e-149) {
tmp = t_2;
} else if ((x * y) <= 8e-127) {
tmp = t_1;
} else if ((x * y) <= 4.6e+101) {
tmp = t_2;
} else {
tmp = t_3;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: tmp
t_1 = 2.0d0 * (z * t)
t_2 = 2.0d0 * (c * (a * -i))
t_3 = 2.0d0 * (x * y)
if ((x * y) <= (-5.5d+122)) then
tmp = t_3
else if ((x * y) <= (-1.7d-59)) then
tmp = t_1
else if ((x * y) <= (-2.5d-149)) then
tmp = t_2
else if ((x * y) <= 8d-127) then
tmp = t_1
else if ((x * y) <= 4.6d+101) then
tmp = t_2
else
tmp = t_3
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = 2.0 * (z * t);
double t_2 = 2.0 * (c * (a * -i));
double t_3 = 2.0 * (x * y);
double tmp;
if ((x * y) <= -5.5e+122) {
tmp = t_3;
} else if ((x * y) <= -1.7e-59) {
tmp = t_1;
} else if ((x * y) <= -2.5e-149) {
tmp = t_2;
} else if ((x * y) <= 8e-127) {
tmp = t_1;
} else if ((x * y) <= 4.6e+101) {
tmp = t_2;
} else {
tmp = t_3;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = 2.0 * (z * t) t_2 = 2.0 * (c * (a * -i)) t_3 = 2.0 * (x * y) tmp = 0 if (x * y) <= -5.5e+122: tmp = t_3 elif (x * y) <= -1.7e-59: tmp = t_1 elif (x * y) <= -2.5e-149: tmp = t_2 elif (x * y) <= 8e-127: tmp = t_1 elif (x * y) <= 4.6e+101: tmp = t_2 else: tmp = t_3 return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(2.0 * Float64(z * t)) t_2 = Float64(2.0 * Float64(c * Float64(a * Float64(-i)))) t_3 = Float64(2.0 * Float64(x * y)) tmp = 0.0 if (Float64(x * y) <= -5.5e+122) tmp = t_3; elseif (Float64(x * y) <= -1.7e-59) tmp = t_1; elseif (Float64(x * y) <= -2.5e-149) tmp = t_2; elseif (Float64(x * y) <= 8e-127) tmp = t_1; elseif (Float64(x * y) <= 4.6e+101) tmp = t_2; else tmp = t_3; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = 2.0 * (z * t); t_2 = 2.0 * (c * (a * -i)); t_3 = 2.0 * (x * y); tmp = 0.0; if ((x * y) <= -5.5e+122) tmp = t_3; elseif ((x * y) <= -1.7e-59) tmp = t_1; elseif ((x * y) <= -2.5e-149) tmp = t_2; elseif ((x * y) <= 8e-127) tmp = t_1; elseif ((x * y) <= 4.6e+101) tmp = t_2; else tmp = t_3; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(2.0 * N[(z * t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(2.0 * N[(c * N[(a * (-i)), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(2.0 * N[(x * y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x * y), $MachinePrecision], -5.5e+122], t$95$3, If[LessEqual[N[(x * y), $MachinePrecision], -1.7e-59], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], -2.5e-149], t$95$2, If[LessEqual[N[(x * y), $MachinePrecision], 8e-127], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], 4.6e+101], t$95$2, t$95$3]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := 2 \cdot \left(z \cdot t\right)\\
t_2 := 2 \cdot \left(c \cdot \left(a \cdot \left(-i\right)\right)\right)\\
t_3 := 2 \cdot \left(x \cdot y\right)\\
\mathbf{if}\;x \cdot y \leq -5.5 \cdot 10^{+122}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;x \cdot y \leq -1.7 \cdot 10^{-59}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \cdot y \leq -2.5 \cdot 10^{-149}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;x \cdot y \leq 8 \cdot 10^{-127}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \cdot y \leq 4.6 \cdot 10^{+101}:\\
\;\;\;\;t_2\\
\mathbf{else}:\\
\;\;\;\;t_3\\
\end{array}
\end{array}
if (*.f64 x y) < -5.4999999999999998e122 or 4.6000000000000003e101 < (*.f64 x y) Initial program 91.8%
Taylor expanded in x around inf 69.0%
if -5.4999999999999998e122 < (*.f64 x y) < -1.70000000000000009e-59 or -2.49999999999999984e-149 < (*.f64 x y) < 8.0000000000000002e-127Initial program 93.3%
Taylor expanded in z around inf 41.2%
if -1.70000000000000009e-59 < (*.f64 x y) < -2.49999999999999984e-149 or 8.0000000000000002e-127 < (*.f64 x y) < 4.6000000000000003e101Initial program 93.1%
Taylor expanded in a around inf 44.1%
mul-1-neg44.1%
*-commutative44.1%
associate-*l*39.1%
Simplified39.1%
Final simplification50.0%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* 2.0 (* z t))) (t_2 (* 2.0 (* x y))))
(if (<= (* x y) -6.4e+125)
t_2
(if (<= (* x y) -2.8e-53)
t_1
(if (<= (* x y) -1.95e-150)
(* 2.0 (* c (* a (- i))))
(if (<= (* x y) 4.1e-126)
t_1
(if (<= (* x y) 1.35e+101) (* 2.0 (* a (* c (- i)))) t_2)))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = 2.0 * (z * t);
double t_2 = 2.0 * (x * y);
double tmp;
if ((x * y) <= -6.4e+125) {
tmp = t_2;
} else if ((x * y) <= -2.8e-53) {
tmp = t_1;
} else if ((x * y) <= -1.95e-150) {
tmp = 2.0 * (c * (a * -i));
} else if ((x * y) <= 4.1e-126) {
tmp = t_1;
} else if ((x * y) <= 1.35e+101) {
tmp = 2.0 * (a * (c * -i));
} else {
tmp = t_2;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = 2.0d0 * (z * t)
t_2 = 2.0d0 * (x * y)
if ((x * y) <= (-6.4d+125)) then
tmp = t_2
else if ((x * y) <= (-2.8d-53)) then
tmp = t_1
else if ((x * y) <= (-1.95d-150)) then
tmp = 2.0d0 * (c * (a * -i))
else if ((x * y) <= 4.1d-126) then
tmp = t_1
else if ((x * y) <= 1.35d+101) then
tmp = 2.0d0 * (a * (c * -i))
else
tmp = t_2
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = 2.0 * (z * t);
double t_2 = 2.0 * (x * y);
double tmp;
if ((x * y) <= -6.4e+125) {
tmp = t_2;
} else if ((x * y) <= -2.8e-53) {
tmp = t_1;
} else if ((x * y) <= -1.95e-150) {
tmp = 2.0 * (c * (a * -i));
} else if ((x * y) <= 4.1e-126) {
tmp = t_1;
} else if ((x * y) <= 1.35e+101) {
tmp = 2.0 * (a * (c * -i));
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = 2.0 * (z * t) t_2 = 2.0 * (x * y) tmp = 0 if (x * y) <= -6.4e+125: tmp = t_2 elif (x * y) <= -2.8e-53: tmp = t_1 elif (x * y) <= -1.95e-150: tmp = 2.0 * (c * (a * -i)) elif (x * y) <= 4.1e-126: tmp = t_1 elif (x * y) <= 1.35e+101: tmp = 2.0 * (a * (c * -i)) else: tmp = t_2 return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(2.0 * Float64(z * t)) t_2 = Float64(2.0 * Float64(x * y)) tmp = 0.0 if (Float64(x * y) <= -6.4e+125) tmp = t_2; elseif (Float64(x * y) <= -2.8e-53) tmp = t_1; elseif (Float64(x * y) <= -1.95e-150) tmp = Float64(2.0 * Float64(c * Float64(a * Float64(-i)))); elseif (Float64(x * y) <= 4.1e-126) tmp = t_1; elseif (Float64(x * y) <= 1.35e+101) tmp = Float64(2.0 * Float64(a * Float64(c * Float64(-i)))); else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = 2.0 * (z * t); t_2 = 2.0 * (x * y); tmp = 0.0; if ((x * y) <= -6.4e+125) tmp = t_2; elseif ((x * y) <= -2.8e-53) tmp = t_1; elseif ((x * y) <= -1.95e-150) tmp = 2.0 * (c * (a * -i)); elseif ((x * y) <= 4.1e-126) tmp = t_1; elseif ((x * y) <= 1.35e+101) tmp = 2.0 * (a * (c * -i)); else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(2.0 * N[(z * t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(2.0 * N[(x * y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x * y), $MachinePrecision], -6.4e+125], t$95$2, If[LessEqual[N[(x * y), $MachinePrecision], -2.8e-53], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], -1.95e-150], N[(2.0 * N[(c * N[(a * (-i)), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 4.1e-126], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], 1.35e+101], N[(2.0 * N[(a * N[(c * (-i)), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$2]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := 2 \cdot \left(z \cdot t\right)\\
t_2 := 2 \cdot \left(x \cdot y\right)\\
\mathbf{if}\;x \cdot y \leq -6.4 \cdot 10^{+125}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;x \cdot y \leq -2.8 \cdot 10^{-53}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \cdot y \leq -1.95 \cdot 10^{-150}:\\
\;\;\;\;2 \cdot \left(c \cdot \left(a \cdot \left(-i\right)\right)\right)\\
\mathbf{elif}\;x \cdot y \leq 4.1 \cdot 10^{-126}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \cdot y \leq 1.35 \cdot 10^{+101}:\\
\;\;\;\;2 \cdot \left(a \cdot \left(c \cdot \left(-i\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if (*.f64 x y) < -6.39999999999999967e125 or 1.35000000000000003e101 < (*.f64 x y) Initial program 91.8%
Taylor expanded in x around inf 69.0%
if -6.39999999999999967e125 < (*.f64 x y) < -2.79999999999999985e-53 or -1.9500000000000001e-150 < (*.f64 x y) < 4.0999999999999997e-126Initial program 93.3%
Taylor expanded in z around inf 41.2%
if -2.79999999999999985e-53 < (*.f64 x y) < -1.9500000000000001e-150Initial program 93.7%
Taylor expanded in a around inf 47.9%
mul-1-neg47.9%
*-commutative47.9%
associate-*l*48.0%
Simplified48.0%
if 4.0999999999999997e-126 < (*.f64 x y) < 1.35000000000000003e101Initial program 92.9%
Taylor expanded in a around inf 43.0%
mul-1-neg43.0%
distribute-rgt-neg-in43.0%
*-commutative43.0%
distribute-rgt-neg-in43.0%
Simplified43.0%
Final simplification51.1%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ a (* b c))) (t_2 (* c t_1)))
(if (<= t_2 -2e+298)
(* 2.0 (* c (* i (- (- a) (* b c)))))
(if (<= t_2 1e+275)
(* 2.0 (- (+ (* x y) (* z t)) (* i t_2)))
(* 2.0 (- (* x y) (* c (* t_1 i))))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = a + (b * c);
double t_2 = c * t_1;
double tmp;
if (t_2 <= -2e+298) {
tmp = 2.0 * (c * (i * (-a - (b * c))));
} else if (t_2 <= 1e+275) {
tmp = 2.0 * (((x * y) + (z * t)) - (i * t_2));
} else {
tmp = 2.0 * ((x * y) - (c * (t_1 * i)));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = a + (b * c)
t_2 = c * t_1
if (t_2 <= (-2d+298)) then
tmp = 2.0d0 * (c * (i * (-a - (b * c))))
else if (t_2 <= 1d+275) then
tmp = 2.0d0 * (((x * y) + (z * t)) - (i * t_2))
else
tmp = 2.0d0 * ((x * y) - (c * (t_1 * i)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = a + (b * c);
double t_2 = c * t_1;
double tmp;
if (t_2 <= -2e+298) {
tmp = 2.0 * (c * (i * (-a - (b * c))));
} else if (t_2 <= 1e+275) {
tmp = 2.0 * (((x * y) + (z * t)) - (i * t_2));
} else {
tmp = 2.0 * ((x * y) - (c * (t_1 * i)));
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = a + (b * c) t_2 = c * t_1 tmp = 0 if t_2 <= -2e+298: tmp = 2.0 * (c * (i * (-a - (b * c)))) elif t_2 <= 1e+275: tmp = 2.0 * (((x * y) + (z * t)) - (i * t_2)) else: tmp = 2.0 * ((x * y) - (c * (t_1 * i))) return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(a + Float64(b * c)) t_2 = Float64(c * t_1) tmp = 0.0 if (t_2 <= -2e+298) tmp = Float64(2.0 * Float64(c * Float64(i * Float64(Float64(-a) - Float64(b * c))))); elseif (t_2 <= 1e+275) tmp = Float64(2.0 * Float64(Float64(Float64(x * y) + Float64(z * t)) - Float64(i * t_2))); else tmp = Float64(2.0 * Float64(Float64(x * y) - Float64(c * Float64(t_1 * i)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = a + (b * c); t_2 = c * t_1; tmp = 0.0; if (t_2 <= -2e+298) tmp = 2.0 * (c * (i * (-a - (b * c)))); elseif (t_2 <= 1e+275) tmp = 2.0 * (((x * y) + (z * t)) - (i * t_2)); else tmp = 2.0 * ((x * y) - (c * (t_1 * i))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(c * t$95$1), $MachinePrecision]}, If[LessEqual[t$95$2, -2e+298], N[(2.0 * N[(c * N[(i * N[((-a) - N[(b * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, 1e+275], N[(2.0 * N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] - N[(i * t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[(x * y), $MachinePrecision] - N[(c * N[(t$95$1 * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a + b \cdot c\\
t_2 := c \cdot t_1\\
\mathbf{if}\;t_2 \leq -2 \cdot 10^{+298}:\\
\;\;\;\;2 \cdot \left(c \cdot \left(i \cdot \left(\left(-a\right) - b \cdot c\right)\right)\right)\\
\mathbf{elif}\;t_2 \leq 10^{+275}:\\
\;\;\;\;2 \cdot \left(\left(x \cdot y + z \cdot t\right) - i \cdot t_2\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(x \cdot y - c \cdot \left(t_1 \cdot i\right)\right)\\
\end{array}
\end{array}
if (*.f64 (+.f64 a (*.f64 b c)) c) < -1.9999999999999999e298Initial program 82.1%
Taylor expanded in i around inf 97.6%
if -1.9999999999999999e298 < (*.f64 (+.f64 a (*.f64 b c)) c) < 9.9999999999999996e274Initial program 99.2%
if 9.9999999999999996e274 < (*.f64 (+.f64 a (*.f64 b c)) c) Initial program 76.8%
Taylor expanded in z around 0 90.6%
Final simplification97.6%
(FPCore (x y z t a b c i)
:precision binary64
(if (or (<= c -1.3e+37)
(and (not (<= c -7.5e+22))
(or (<= c -1.7e-43) (not (<= c 265000000.0)))))
(* 2.0 (* c (* i (- (- a) (* b c)))))
(* 2.0 (+ (* x y) (* z t)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((c <= -1.3e+37) || (!(c <= -7.5e+22) && ((c <= -1.7e-43) || !(c <= 265000000.0)))) {
tmp = 2.0 * (c * (i * (-a - (b * c))));
} else {
tmp = 2.0 * ((x * y) + (z * t));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: tmp
if ((c <= (-1.3d+37)) .or. (.not. (c <= (-7.5d+22))) .and. (c <= (-1.7d-43)) .or. (.not. (c <= 265000000.0d0))) then
tmp = 2.0d0 * (c * (i * (-a - (b * c))))
else
tmp = 2.0d0 * ((x * y) + (z * t))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((c <= -1.3e+37) || (!(c <= -7.5e+22) && ((c <= -1.7e-43) || !(c <= 265000000.0)))) {
tmp = 2.0 * (c * (i * (-a - (b * c))));
} else {
tmp = 2.0 * ((x * y) + (z * t));
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if (c <= -1.3e+37) or (not (c <= -7.5e+22) and ((c <= -1.7e-43) or not (c <= 265000000.0))): tmp = 2.0 * (c * (i * (-a - (b * c)))) else: tmp = 2.0 * ((x * y) + (z * t)) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if ((c <= -1.3e+37) || (!(c <= -7.5e+22) && ((c <= -1.7e-43) || !(c <= 265000000.0)))) tmp = Float64(2.0 * Float64(c * Float64(i * Float64(Float64(-a) - Float64(b * c))))); else tmp = Float64(2.0 * Float64(Float64(x * y) + Float64(z * t))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if ((c <= -1.3e+37) || (~((c <= -7.5e+22)) && ((c <= -1.7e-43) || ~((c <= 265000000.0))))) tmp = 2.0 * (c * (i * (-a - (b * c)))); else tmp = 2.0 * ((x * y) + (z * t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[c, -1.3e+37], And[N[Not[LessEqual[c, -7.5e+22]], $MachinePrecision], Or[LessEqual[c, -1.7e-43], N[Not[LessEqual[c, 265000000.0]], $MachinePrecision]]]], N[(2.0 * N[(c * N[(i * N[((-a) - N[(b * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;c \leq -1.3 \cdot 10^{+37} \lor \neg \left(c \leq -7.5 \cdot 10^{+22}\right) \land \left(c \leq -1.7 \cdot 10^{-43} \lor \neg \left(c \leq 265000000\right)\right):\\
\;\;\;\;2 \cdot \left(c \cdot \left(i \cdot \left(\left(-a\right) - b \cdot c\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(x \cdot y + z \cdot t\right)\\
\end{array}
\end{array}
if c < -1.3e37 or -7.5000000000000002e22 < c < -1.7e-43 or 2.65e8 < c Initial program 86.6%
Taylor expanded in i around inf 85.3%
if -1.3e37 < c < -7.5000000000000002e22 or -1.7e-43 < c < 2.65e8Initial program 98.4%
Taylor expanded in c around 0 82.8%
Final simplification84.0%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* a (* c i))))
(if (<= (* x y) -3e+142)
(* 2.0 (- (* x y) t_1))
(if (or (<= (* x y) -1.02e-78) (not (<= (* x y) 1.12e+101)))
(* 2.0 (+ (* x y) (* z t)))
(* 2.0 (- (* z t) t_1))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = a * (c * i);
double tmp;
if ((x * y) <= -3e+142) {
tmp = 2.0 * ((x * y) - t_1);
} else if (((x * y) <= -1.02e-78) || !((x * y) <= 1.12e+101)) {
tmp = 2.0 * ((x * y) + (z * t));
} else {
tmp = 2.0 * ((z * t) - t_1);
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: t_1
real(8) :: tmp
t_1 = a * (c * i)
if ((x * y) <= (-3d+142)) then
tmp = 2.0d0 * ((x * y) - t_1)
else if (((x * y) <= (-1.02d-78)) .or. (.not. ((x * y) <= 1.12d+101))) then
tmp = 2.0d0 * ((x * y) + (z * t))
else
tmp = 2.0d0 * ((z * t) - t_1)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = a * (c * i);
double tmp;
if ((x * y) <= -3e+142) {
tmp = 2.0 * ((x * y) - t_1);
} else if (((x * y) <= -1.02e-78) || !((x * y) <= 1.12e+101)) {
tmp = 2.0 * ((x * y) + (z * t));
} else {
tmp = 2.0 * ((z * t) - t_1);
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = a * (c * i) tmp = 0 if (x * y) <= -3e+142: tmp = 2.0 * ((x * y) - t_1) elif ((x * y) <= -1.02e-78) or not ((x * y) <= 1.12e+101): tmp = 2.0 * ((x * y) + (z * t)) else: tmp = 2.0 * ((z * t) - t_1) return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(a * Float64(c * i)) tmp = 0.0 if (Float64(x * y) <= -3e+142) tmp = Float64(2.0 * Float64(Float64(x * y) - t_1)); elseif ((Float64(x * y) <= -1.02e-78) || !(Float64(x * y) <= 1.12e+101)) tmp = Float64(2.0 * Float64(Float64(x * y) + Float64(z * t))); else tmp = Float64(2.0 * Float64(Float64(z * t) - t_1)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = a * (c * i); tmp = 0.0; if ((x * y) <= -3e+142) tmp = 2.0 * ((x * y) - t_1); elseif (((x * y) <= -1.02e-78) || ~(((x * y) <= 1.12e+101))) tmp = 2.0 * ((x * y) + (z * t)); else tmp = 2.0 * ((z * t) - t_1); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(a * N[(c * i), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x * y), $MachinePrecision], -3e+142], N[(2.0 * N[(N[(x * y), $MachinePrecision] - t$95$1), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[N[(x * y), $MachinePrecision], -1.02e-78], N[Not[LessEqual[N[(x * y), $MachinePrecision], 1.12e+101]], $MachinePrecision]], N[(2.0 * N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[(z * t), $MachinePrecision] - t$95$1), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a \cdot \left(c \cdot i\right)\\
\mathbf{if}\;x \cdot y \leq -3 \cdot 10^{+142}:\\
\;\;\;\;2 \cdot \left(x \cdot y - t_1\right)\\
\mathbf{elif}\;x \cdot y \leq -1.02 \cdot 10^{-78} \lor \neg \left(x \cdot y \leq 1.12 \cdot 10^{+101}\right):\\
\;\;\;\;2 \cdot \left(x \cdot y + z \cdot t\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(z \cdot t - t_1\right)\\
\end{array}
\end{array}
if (*.f64 x y) < -2.99999999999999975e142Initial program 95.0%
Taylor expanded in a around inf 78.8%
*-commutative78.8%
Simplified78.8%
Taylor expanded in z around 0 82.4%
if -2.99999999999999975e142 < (*.f64 x y) < -1.02e-78 or 1.1199999999999999e101 < (*.f64 x y) Initial program 93.0%
Taylor expanded in c around 0 71.6%
if -1.02e-78 < (*.f64 x y) < 1.1199999999999999e101Initial program 91.9%
Taylor expanded in a around inf 68.7%
*-commutative68.7%
Simplified68.7%
Taylor expanded in x around 0 62.8%
Final simplification68.8%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= c -5.4e-41) (not (<= c 2.9e-50))) (* 2.0 (- (* z t) (* c (* (+ a (* b c)) i)))) (* 2.0 (+ (* x y) (* z t)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((c <= -5.4e-41) || !(c <= 2.9e-50)) {
tmp = 2.0 * ((z * t) - (c * ((a + (b * c)) * i)));
} else {
tmp = 2.0 * ((x * y) + (z * t));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: tmp
if ((c <= (-5.4d-41)) .or. (.not. (c <= 2.9d-50))) then
tmp = 2.0d0 * ((z * t) - (c * ((a + (b * c)) * i)))
else
tmp = 2.0d0 * ((x * y) + (z * t))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((c <= -5.4e-41) || !(c <= 2.9e-50)) {
tmp = 2.0 * ((z * t) - (c * ((a + (b * c)) * i)));
} else {
tmp = 2.0 * ((x * y) + (z * t));
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if (c <= -5.4e-41) or not (c <= 2.9e-50): tmp = 2.0 * ((z * t) - (c * ((a + (b * c)) * i))) else: tmp = 2.0 * ((x * y) + (z * t)) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if ((c <= -5.4e-41) || !(c <= 2.9e-50)) tmp = Float64(2.0 * Float64(Float64(z * t) - Float64(c * Float64(Float64(a + Float64(b * c)) * i)))); else tmp = Float64(2.0 * Float64(Float64(x * y) + Float64(z * t))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if ((c <= -5.4e-41) || ~((c <= 2.9e-50))) tmp = 2.0 * ((z * t) - (c * ((a + (b * c)) * i))); else tmp = 2.0 * ((x * y) + (z * t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[c, -5.4e-41], N[Not[LessEqual[c, 2.9e-50]], $MachinePrecision]], N[(2.0 * N[(N[(z * t), $MachinePrecision] - N[(c * N[(N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;c \leq -5.4 \cdot 10^{-41} \lor \neg \left(c \leq 2.9 \cdot 10^{-50}\right):\\
\;\;\;\;2 \cdot \left(z \cdot t - c \cdot \left(\left(a + b \cdot c\right) \cdot i\right)\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(x \cdot y + z \cdot t\right)\\
\end{array}
\end{array}
if c < -5.4e-41 or 2.90000000000000008e-50 < c Initial program 87.6%
Taylor expanded in x around 0 87.0%
if -5.4e-41 < c < 2.90000000000000008e-50Initial program 99.0%
Taylor expanded in c around 0 83.5%
Final simplification85.4%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* c (* (+ a (* b c)) i))))
(if (<= c -4.2e-42)
(* 2.0 (- (* z t) t_1))
(if (<= c 1.35e-64)
(* 2.0 (+ (* x y) (* z t)))
(* 2.0 (- (* x y) t_1))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = c * ((a + (b * c)) * i);
double tmp;
if (c <= -4.2e-42) {
tmp = 2.0 * ((z * t) - t_1);
} else if (c <= 1.35e-64) {
tmp = 2.0 * ((x * y) + (z * t));
} else {
tmp = 2.0 * ((x * y) - t_1);
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: t_1
real(8) :: tmp
t_1 = c * ((a + (b * c)) * i)
if (c <= (-4.2d-42)) then
tmp = 2.0d0 * ((z * t) - t_1)
else if (c <= 1.35d-64) then
tmp = 2.0d0 * ((x * y) + (z * t))
else
tmp = 2.0d0 * ((x * y) - t_1)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = c * ((a + (b * c)) * i);
double tmp;
if (c <= -4.2e-42) {
tmp = 2.0 * ((z * t) - t_1);
} else if (c <= 1.35e-64) {
tmp = 2.0 * ((x * y) + (z * t));
} else {
tmp = 2.0 * ((x * y) - t_1);
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = c * ((a + (b * c)) * i) tmp = 0 if c <= -4.2e-42: tmp = 2.0 * ((z * t) - t_1) elif c <= 1.35e-64: tmp = 2.0 * ((x * y) + (z * t)) else: tmp = 2.0 * ((x * y) - t_1) return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(c * Float64(Float64(a + Float64(b * c)) * i)) tmp = 0.0 if (c <= -4.2e-42) tmp = Float64(2.0 * Float64(Float64(z * t) - t_1)); elseif (c <= 1.35e-64) tmp = Float64(2.0 * Float64(Float64(x * y) + Float64(z * t))); else tmp = Float64(2.0 * Float64(Float64(x * y) - t_1)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = c * ((a + (b * c)) * i); tmp = 0.0; if (c <= -4.2e-42) tmp = 2.0 * ((z * t) - t_1); elseif (c <= 1.35e-64) tmp = 2.0 * ((x * y) + (z * t)); else tmp = 2.0 * ((x * y) - t_1); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(c * N[(N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[c, -4.2e-42], N[(2.0 * N[(N[(z * t), $MachinePrecision] - t$95$1), $MachinePrecision]), $MachinePrecision], If[LessEqual[c, 1.35e-64], N[(2.0 * N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[(x * y), $MachinePrecision] - t$95$1), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := c \cdot \left(\left(a + b \cdot c\right) \cdot i\right)\\
\mathbf{if}\;c \leq -4.2 \cdot 10^{-42}:\\
\;\;\;\;2 \cdot \left(z \cdot t - t_1\right)\\
\mathbf{elif}\;c \leq 1.35 \cdot 10^{-64}:\\
\;\;\;\;2 \cdot \left(x \cdot y + z \cdot t\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(x \cdot y - t_1\right)\\
\end{array}
\end{array}
if c < -4.20000000000000013e-42Initial program 83.4%
Taylor expanded in x around 0 85.8%
if -4.20000000000000013e-42 < c < 1.34999999999999993e-64Initial program 99.0%
Taylor expanded in c around 0 84.6%
if 1.34999999999999993e-64 < c Initial program 92.1%
Taylor expanded in z around 0 90.9%
Final simplification86.8%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* c (* (+ a (* b c)) i))))
(if (<= c -1.1e-40)
(* 2.0 (- (* z t) t_1))
(if (<= c 6.4e-50)
(* 2.0 (- (+ (* x y) (* z t)) (* i (* a c))))
(* 2.0 (- (* x y) t_1))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = c * ((a + (b * c)) * i);
double tmp;
if (c <= -1.1e-40) {
tmp = 2.0 * ((z * t) - t_1);
} else if (c <= 6.4e-50) {
tmp = 2.0 * (((x * y) + (z * t)) - (i * (a * c)));
} else {
tmp = 2.0 * ((x * y) - t_1);
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: t_1
real(8) :: tmp
t_1 = c * ((a + (b * c)) * i)
if (c <= (-1.1d-40)) then
tmp = 2.0d0 * ((z * t) - t_1)
else if (c <= 6.4d-50) then
tmp = 2.0d0 * (((x * y) + (z * t)) - (i * (a * c)))
else
tmp = 2.0d0 * ((x * y) - t_1)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = c * ((a + (b * c)) * i);
double tmp;
if (c <= -1.1e-40) {
tmp = 2.0 * ((z * t) - t_1);
} else if (c <= 6.4e-50) {
tmp = 2.0 * (((x * y) + (z * t)) - (i * (a * c)));
} else {
tmp = 2.0 * ((x * y) - t_1);
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = c * ((a + (b * c)) * i) tmp = 0 if c <= -1.1e-40: tmp = 2.0 * ((z * t) - t_1) elif c <= 6.4e-50: tmp = 2.0 * (((x * y) + (z * t)) - (i * (a * c))) else: tmp = 2.0 * ((x * y) - t_1) return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(c * Float64(Float64(a + Float64(b * c)) * i)) tmp = 0.0 if (c <= -1.1e-40) tmp = Float64(2.0 * Float64(Float64(z * t) - t_1)); elseif (c <= 6.4e-50) tmp = Float64(2.0 * Float64(Float64(Float64(x * y) + Float64(z * t)) - Float64(i * Float64(a * c)))); else tmp = Float64(2.0 * Float64(Float64(x * y) - t_1)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = c * ((a + (b * c)) * i); tmp = 0.0; if (c <= -1.1e-40) tmp = 2.0 * ((z * t) - t_1); elseif (c <= 6.4e-50) tmp = 2.0 * (((x * y) + (z * t)) - (i * (a * c))); else tmp = 2.0 * ((x * y) - t_1); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(c * N[(N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[c, -1.1e-40], N[(2.0 * N[(N[(z * t), $MachinePrecision] - t$95$1), $MachinePrecision]), $MachinePrecision], If[LessEqual[c, 6.4e-50], N[(2.0 * N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] - N[(i * N[(a * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[(x * y), $MachinePrecision] - t$95$1), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := c \cdot \left(\left(a + b \cdot c\right) \cdot i\right)\\
\mathbf{if}\;c \leq -1.1 \cdot 10^{-40}:\\
\;\;\;\;2 \cdot \left(z \cdot t - t_1\right)\\
\mathbf{elif}\;c \leq 6.4 \cdot 10^{-50}:\\
\;\;\;\;2 \cdot \left(\left(x \cdot y + z \cdot t\right) - i \cdot \left(a \cdot c\right)\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(x \cdot y - t_1\right)\\
\end{array}
\end{array}
if c < -1.10000000000000004e-40Initial program 83.4%
Taylor expanded in x around 0 85.8%
if -1.10000000000000004e-40 < c < 6.4e-50Initial program 99.1%
Taylor expanded in a around inf 95.7%
*-commutative95.7%
Simplified95.7%
if 6.4e-50 < c Initial program 91.6%
Taylor expanded in z around 0 91.7%
Final simplification91.9%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= c -5.4e+95) (not (<= c 1800000000.0))) (* 2.0 (- (* z t) (* a (* c i)))) (* 2.0 (+ (* x y) (* z t)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((c <= -5.4e+95) || !(c <= 1800000000.0)) {
tmp = 2.0 * ((z * t) - (a * (c * i)));
} else {
tmp = 2.0 * ((x * y) + (z * t));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: tmp
if ((c <= (-5.4d+95)) .or. (.not. (c <= 1800000000.0d0))) then
tmp = 2.0d0 * ((z * t) - (a * (c * i)))
else
tmp = 2.0d0 * ((x * y) + (z * t))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((c <= -5.4e+95) || !(c <= 1800000000.0)) {
tmp = 2.0 * ((z * t) - (a * (c * i)));
} else {
tmp = 2.0 * ((x * y) + (z * t));
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if (c <= -5.4e+95) or not (c <= 1800000000.0): tmp = 2.0 * ((z * t) - (a * (c * i))) else: tmp = 2.0 * ((x * y) + (z * t)) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if ((c <= -5.4e+95) || !(c <= 1800000000.0)) tmp = Float64(2.0 * Float64(Float64(z * t) - Float64(a * Float64(c * i)))); else tmp = Float64(2.0 * Float64(Float64(x * y) + Float64(z * t))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if ((c <= -5.4e+95) || ~((c <= 1800000000.0))) tmp = 2.0 * ((z * t) - (a * (c * i))); else tmp = 2.0 * ((x * y) + (z * t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[c, -5.4e+95], N[Not[LessEqual[c, 1800000000.0]], $MachinePrecision]], N[(2.0 * N[(N[(z * t), $MachinePrecision] - N[(a * N[(c * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;c \leq -5.4 \cdot 10^{+95} \lor \neg \left(c \leq 1800000000\right):\\
\;\;\;\;2 \cdot \left(z \cdot t - a \cdot \left(c \cdot i\right)\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(x \cdot y + z \cdot t\right)\\
\end{array}
\end{array}
if c < -5.4e95 or 1.8e9 < c Initial program 84.6%
Taylor expanded in a around inf 52.2%
*-commutative52.2%
Simplified52.2%
Taylor expanded in x around 0 49.9%
if -5.4e95 < c < 1.8e9Initial program 98.0%
Taylor expanded in c around 0 76.6%
Final simplification66.2%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= (* x y) -5.2e+121) (not (<= (* x y) 5.7e+32))) (* 2.0 (* x y)) (* 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) <= -5.2e+121) || !((x * y) <= 5.7e+32)) {
tmp = 2.0 * (x * y);
} 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) <= (-5.2d+121)) .or. (.not. ((x * y) <= 5.7d+32))) then
tmp = 2.0d0 * (x * y)
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) <= -5.2e+121) || !((x * y) <= 5.7e+32)) {
tmp = 2.0 * (x * y);
} else {
tmp = 2.0 * (z * t);
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if ((x * y) <= -5.2e+121) or not ((x * y) <= 5.7e+32): tmp = 2.0 * (x * y) 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) <= -5.2e+121) || !(Float64(x * y) <= 5.7e+32)) tmp = Float64(2.0 * Float64(x * y)); 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) <= -5.2e+121) || ~(((x * y) <= 5.7e+32))) tmp = 2.0 * (x * y); 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], -5.2e+121], N[Not[LessEqual[N[(x * y), $MachinePrecision], 5.7e+32]], $MachinePrecision]], N[(2.0 * N[(x * y), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(z * t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \cdot y \leq -5.2 \cdot 10^{+121} \lor \neg \left(x \cdot y \leq 5.7 \cdot 10^{+32}\right):\\
\;\;\;\;2 \cdot \left(x \cdot y\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(z \cdot t\right)\\
\end{array}
\end{array}
if (*.f64 x y) < -5.1999999999999998e121 or 5.7e32 < (*.f64 x y) Initial program 91.7%
Taylor expanded in x around inf 63.4%
if -5.1999999999999998e121 < (*.f64 x y) < 5.7e32Initial program 93.4%
Taylor expanded in z around inf 36.2%
Final simplification46.4%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= c -1.55e+99) (not (<= c 92000000000.0))) (* 2.0 (* a (* c (- i)))) (* 2.0 (+ (* x y) (* z t)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((c <= -1.55e+99) || !(c <= 92000000000.0)) {
tmp = 2.0 * (a * (c * -i));
} else {
tmp = 2.0 * ((x * y) + (z * t));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: tmp
if ((c <= (-1.55d+99)) .or. (.not. (c <= 92000000000.0d0))) then
tmp = 2.0d0 * (a * (c * -i))
else
tmp = 2.0d0 * ((x * y) + (z * t))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((c <= -1.55e+99) || !(c <= 92000000000.0)) {
tmp = 2.0 * (a * (c * -i));
} else {
tmp = 2.0 * ((x * y) + (z * t));
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if (c <= -1.55e+99) or not (c <= 92000000000.0): tmp = 2.0 * (a * (c * -i)) else: tmp = 2.0 * ((x * y) + (z * t)) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if ((c <= -1.55e+99) || !(c <= 92000000000.0)) tmp = Float64(2.0 * Float64(a * Float64(c * Float64(-i)))); else tmp = Float64(2.0 * Float64(Float64(x * y) + Float64(z * t))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if ((c <= -1.55e+99) || ~((c <= 92000000000.0))) tmp = 2.0 * (a * (c * -i)); else tmp = 2.0 * ((x * y) + (z * t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[c, -1.55e+99], N[Not[LessEqual[c, 92000000000.0]], $MachinePrecision]], N[(2.0 * N[(a * N[(c * (-i)), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;c \leq -1.55 \cdot 10^{+99} \lor \neg \left(c \leq 92000000000\right):\\
\;\;\;\;2 \cdot \left(a \cdot \left(c \cdot \left(-i\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(x \cdot y + z \cdot t\right)\\
\end{array}
\end{array}
if c < -1.55e99 or 9.2e10 < c Initial program 84.6%
Taylor expanded in a around inf 44.3%
mul-1-neg44.3%
distribute-rgt-neg-in44.3%
*-commutative44.3%
distribute-rgt-neg-in44.3%
Simplified44.3%
if -1.55e99 < c < 9.2e10Initial program 98.0%
Taylor expanded in c around 0 76.6%
Final simplification64.0%
(FPCore (x y z t a b c i) :precision binary64 (* 2.0 (- (+ (* x y) (* z t)) (* (+ a (* b c)) (* c i)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return 2.0 * (((x * y) + (z * t)) - ((a + (b * c)) * (c * i)));
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
code = 2.0d0 * (((x * y) + (z * t)) - ((a + (b * c)) * (c * i)))
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return 2.0 * (((x * y) + (z * t)) - ((a + (b * c)) * (c * i)));
}
def code(x, y, z, t, a, b, c, i): return 2.0 * (((x * y) + (z * t)) - ((a + (b * c)) * (c * i)))
function code(x, y, z, t, a, b, c, i) return Float64(2.0 * Float64(Float64(Float64(x * y) + Float64(z * t)) - Float64(Float64(a + Float64(b * c)) * Float64(c * i)))) end
function tmp = code(x, y, z, t, a, b, c, i) tmp = 2.0 * (((x * y) + (z * t)) - ((a + (b * c)) * (c * i))); end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(2.0 * N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] - N[(N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision] * N[(c * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
2 \cdot \left(\left(x \cdot y + z \cdot t\right) - \left(a + b \cdot c\right) \cdot \left(c \cdot i\right)\right)
\end{array}
Initial program 92.7%
fma-def92.8%
associate-*l*97.9%
Simplified97.9%
fma-def97.9%
+-commutative97.9%
Applied egg-rr97.9%
Final simplification97.9%
(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 92.7%
Taylor expanded in z around inf 25.3%
Final simplification25.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 2024020
(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))))