
(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 12 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a b c i) :precision binary64 (* 2.0 (- (+ (* x y) (* z t)) (* (* (+ a (* b c)) c) i))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return 2.0 * (((x * y) + (z * t)) - (((a + (b * c)) * c) * i));
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
code = 2.0d0 * (((x * y) + (z * t)) - (((a + (b * c)) * c) * i))
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return 2.0 * (((x * y) + (z * t)) - (((a + (b * c)) * c) * i));
}
def code(x, y, z, t, a, b, c, i): return 2.0 * (((x * y) + (z * t)) - (((a + (b * c)) * c) * i))
function code(x, y, z, t, a, b, c, i) return Float64(2.0 * Float64(Float64(Float64(x * y) + Float64(z * t)) - Float64(Float64(Float64(a + Float64(b * c)) * c) * i))) end
function tmp = code(x, y, z, t, a, b, c, i) tmp = 2.0 * (((x * y) + (z * t)) - (((a + (b * c)) * c) * i)); end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(2.0 * N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] - N[(N[(N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision] * c), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
2 \cdot \left(\left(x \cdot y + z \cdot t\right) - \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i\right)
\end{array}
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ a (* b c))) (t_2 (+ (* x y) (* z t))))
(if (<= (- t_2 (* (* c t_1) i)) INFINITY)
(* 2.0 (- t_2 (* t_1 (* c i))))
(* y (+ (* -2.0 (/ (* c (* t_1 i)) y)) (* x 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 = (x * y) + (z * t);
double tmp;
if ((t_2 - ((c * t_1) * i)) <= ((double) INFINITY)) {
tmp = 2.0 * (t_2 - (t_1 * (c * i)));
} else {
tmp = y * ((-2.0 * ((c * (t_1 * i)) / y)) + (x * 2.0));
}
return tmp;
}
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = a + (b * c);
double t_2 = (x * y) + (z * t);
double tmp;
if ((t_2 - ((c * t_1) * i)) <= Double.POSITIVE_INFINITY) {
tmp = 2.0 * (t_2 - (t_1 * (c * i)));
} else {
tmp = y * ((-2.0 * ((c * (t_1 * i)) / y)) + (x * 2.0));
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = a + (b * c) t_2 = (x * y) + (z * t) tmp = 0 if (t_2 - ((c * t_1) * i)) <= math.inf: tmp = 2.0 * (t_2 - (t_1 * (c * i))) else: tmp = y * ((-2.0 * ((c * (t_1 * i)) / y)) + (x * 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(x * y) + Float64(z * t)) tmp = 0.0 if (Float64(t_2 - Float64(Float64(c * t_1) * i)) <= Inf) tmp = Float64(2.0 * Float64(t_2 - Float64(t_1 * Float64(c * i)))); else tmp = Float64(y * Float64(Float64(-2.0 * Float64(Float64(c * Float64(t_1 * i)) / y)) + Float64(x * 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 = (x * y) + (z * t); tmp = 0.0; if ((t_2 - ((c * t_1) * i)) <= Inf) tmp = 2.0 * (t_2 - (t_1 * (c * i))); else tmp = y * ((-2.0 * ((c * (t_1 * i)) / y)) + (x * 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[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(t$95$2 - N[(N[(c * t$95$1), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision], Infinity], N[(2.0 * N[(t$95$2 - N[(t$95$1 * N[(c * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y * N[(N[(-2.0 * N[(N[(c * N[(t$95$1 * i), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision] + N[(x * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a + b \cdot c\\
t_2 := x \cdot y + z \cdot t\\
\mathbf{if}\;t\_2 - \left(c \cdot t\_1\right) \cdot i \leq \infty:\\
\;\;\;\;2 \cdot \left(t\_2 - t\_1 \cdot \left(c \cdot i\right)\right)\\
\mathbf{else}:\\
\;\;\;\;y \cdot \left(-2 \cdot \frac{c \cdot \left(t\_1 \cdot i\right)}{y} + x \cdot 2\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.5%
fma-define92.5%
associate-*l*96.0%
Simplified96.0%
fma-define96.0%
+-commutative96.0%
Applied egg-rr96.0%
if +inf.0 < (-.f64 (+.f64 (*.f64 x y) (*.f64 z t)) (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i)) Initial program 0.0%
associate--l+0.0%
*-commutative0.0%
associate--l+0.0%
associate--l+0.0%
*-commutative0.0%
associate--l+0.0%
fma-define11.1%
*-commutative11.1%
associate-*l*22.2%
+-commutative22.2%
fma-define22.2%
Simplified22.2%
Taylor expanded in y around inf 61.1%
Taylor expanded in t around 0 77.8%
Final simplification94.7%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ a (* b c)))
(t_2 (* -2.0 (* c (* t_1 i))))
(t_3 (* (* c t_1) i))
(t_4 (* 2.0 (- (* x y) t_3))))
(if (<= t_3 (- INFINITY))
t_2
(if (<= t_3 -4e+79)
t_4
(if (<= t_3 2e+127)
(* (+ (* x y) (* z t)) 2.0)
(if (<= t_3 1e+305) t_4 t_2))))))
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 = -2.0 * (c * (t_1 * i));
double t_3 = (c * t_1) * i;
double t_4 = 2.0 * ((x * y) - t_3);
double tmp;
if (t_3 <= -((double) INFINITY)) {
tmp = t_2;
} else if (t_3 <= -4e+79) {
tmp = t_4;
} else if (t_3 <= 2e+127) {
tmp = ((x * y) + (z * t)) * 2.0;
} else if (t_3 <= 1e+305) {
tmp = t_4;
} else {
tmp = t_2;
}
return tmp;
}
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = a + (b * c);
double t_2 = -2.0 * (c * (t_1 * i));
double t_3 = (c * t_1) * i;
double t_4 = 2.0 * ((x * y) - t_3);
double tmp;
if (t_3 <= -Double.POSITIVE_INFINITY) {
tmp = t_2;
} else if (t_3 <= -4e+79) {
tmp = t_4;
} else if (t_3 <= 2e+127) {
tmp = ((x * y) + (z * t)) * 2.0;
} else if (t_3 <= 1e+305) {
tmp = t_4;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = a + (b * c) t_2 = -2.0 * (c * (t_1 * i)) t_3 = (c * t_1) * i t_4 = 2.0 * ((x * y) - t_3) tmp = 0 if t_3 <= -math.inf: tmp = t_2 elif t_3 <= -4e+79: tmp = t_4 elif t_3 <= 2e+127: tmp = ((x * y) + (z * t)) * 2.0 elif t_3 <= 1e+305: tmp = t_4 else: tmp = t_2 return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(a + Float64(b * c)) t_2 = Float64(-2.0 * Float64(c * Float64(t_1 * i))) t_3 = Float64(Float64(c * t_1) * i) t_4 = Float64(2.0 * Float64(Float64(x * y) - t_3)) tmp = 0.0 if (t_3 <= Float64(-Inf)) tmp = t_2; elseif (t_3 <= -4e+79) tmp = t_4; elseif (t_3 <= 2e+127) tmp = Float64(Float64(Float64(x * y) + Float64(z * t)) * 2.0); elseif (t_3 <= 1e+305) tmp = t_4; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = a + (b * c); t_2 = -2.0 * (c * (t_1 * i)); t_3 = (c * t_1) * i; t_4 = 2.0 * ((x * y) - t_3); tmp = 0.0; if (t_3 <= -Inf) tmp = t_2; elseif (t_3 <= -4e+79) tmp = t_4; elseif (t_3 <= 2e+127) tmp = ((x * y) + (z * t)) * 2.0; elseif (t_3 <= 1e+305) tmp = t_4; else tmp = t_2; 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[(-2.0 * N[(c * N[(t$95$1 * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(c * t$95$1), $MachinePrecision] * i), $MachinePrecision]}, Block[{t$95$4 = N[(2.0 * N[(N[(x * y), $MachinePrecision] - t$95$3), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$3, (-Infinity)], t$95$2, If[LessEqual[t$95$3, -4e+79], t$95$4, If[LessEqual[t$95$3, 2e+127], N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision], If[LessEqual[t$95$3, 1e+305], t$95$4, t$95$2]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a + b \cdot c\\
t_2 := -2 \cdot \left(c \cdot \left(t\_1 \cdot i\right)\right)\\
t_3 := \left(c \cdot t\_1\right) \cdot i\\
t_4 := 2 \cdot \left(x \cdot y - t\_3\right)\\
\mathbf{if}\;t\_3 \leq -\infty:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_3 \leq -4 \cdot 10^{+79}:\\
\;\;\;\;t\_4\\
\mathbf{elif}\;t\_3 \leq 2 \cdot 10^{+127}:\\
\;\;\;\;\left(x \cdot y + z \cdot t\right) \cdot 2\\
\mathbf{elif}\;t\_3 \leq 10^{+305}:\\
\;\;\;\;t\_4\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < -inf.0 or 9.9999999999999994e304 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) Initial program 62.7%
associate--l+62.7%
*-commutative62.7%
associate--l+62.7%
associate--l+62.7%
*-commutative62.7%
associate--l+62.7%
fma-define62.7%
*-commutative62.7%
associate-*l*79.2%
+-commutative79.2%
fma-define79.2%
Simplified79.2%
Taylor expanded in i around inf 85.4%
if -inf.0 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < -3.99999999999999987e79 or 1.99999999999999991e127 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 9.9999999999999994e304Initial program 97.6%
Taylor expanded in x around inf 87.7%
if -3.99999999999999987e79 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 1.99999999999999991e127Initial program 97.5%
associate--l+97.5%
*-commutative97.5%
associate--l+97.5%
associate--l+97.5%
*-commutative97.5%
associate--l+97.5%
fma-define99.2%
*-commutative99.2%
associate-*l*96.7%
+-commutative96.7%
fma-define96.7%
Simplified96.7%
Taylor expanded in c around 0 89.9%
Final simplification88.0%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ a (* b c))) (t_2 (* c t_1)))
(if (or (<= t_2 (- INFINITY)) (not (<= t_2 1e+256)))
(* -2.0 (* c (* t_1 i)))
(* (- (+ (* x y) (* z t)) (* t_2 i)) 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;
double tmp;
if ((t_2 <= -((double) INFINITY)) || !(t_2 <= 1e+256)) {
tmp = -2.0 * (c * (t_1 * i));
} else {
tmp = (((x * y) + (z * t)) - (t_2 * i)) * 2.0;
}
return tmp;
}
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = a + (b * c);
double t_2 = c * t_1;
double tmp;
if ((t_2 <= -Double.POSITIVE_INFINITY) || !(t_2 <= 1e+256)) {
tmp = -2.0 * (c * (t_1 * i));
} else {
tmp = (((x * y) + (z * t)) - (t_2 * i)) * 2.0;
}
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 <= -math.inf) or not (t_2 <= 1e+256): tmp = -2.0 * (c * (t_1 * i)) else: tmp = (((x * y) + (z * t)) - (t_2 * i)) * 2.0 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 <= Float64(-Inf)) || !(t_2 <= 1e+256)) tmp = Float64(-2.0 * Float64(c * Float64(t_1 * i))); else tmp = Float64(Float64(Float64(Float64(x * y) + Float64(z * t)) - Float64(t_2 * i)) * 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; tmp = 0.0; if ((t_2 <= -Inf) || ~((t_2 <= 1e+256))) tmp = -2.0 * (c * (t_1 * i)); else tmp = (((x * y) + (z * t)) - (t_2 * i)) * 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[(c * t$95$1), $MachinePrecision]}, If[Or[LessEqual[t$95$2, (-Infinity)], N[Not[LessEqual[t$95$2, 1e+256]], $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] - N[(t$95$2 * i), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a + b \cdot c\\
t_2 := c \cdot t\_1\\
\mathbf{if}\;t\_2 \leq -\infty \lor \neg \left(t\_2 \leq 10^{+256}\right):\\
\;\;\;\;-2 \cdot \left(c \cdot \left(t\_1 \cdot i\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\left(x \cdot y + z \cdot t\right) - t\_2 \cdot i\right) \cdot 2\\
\end{array}
\end{array}
if (*.f64 (+.f64 a (*.f64 b c)) c) < -inf.0 or 1e256 < (*.f64 (+.f64 a (*.f64 b c)) c) Initial program 58.3%
associate--l+58.3%
*-commutative58.3%
associate--l+58.3%
associate--l+58.3%
*-commutative58.3%
associate--l+58.3%
fma-define58.3%
*-commutative58.3%
associate-*l*76.8%
+-commutative76.8%
fma-define76.8%
Simplified76.8%
Taylor expanded in i around inf 83.6%
if -inf.0 < (*.f64 (+.f64 a (*.f64 b c)) c) < 1e256Initial program 97.7%
Final simplification93.5%
(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+227) (not (<= t_2 2e+277)))
(* -2.0 (* c (* t_1 i)))
(* 2.0 (- (+ (* x y) (* z t)) (* i (* a c)))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = a + (b * c);
double t_2 = (c * t_1) * i;
double tmp;
if ((t_2 <= -5e+227) || !(t_2 <= 2e+277)) {
tmp = -2.0 * (c * (t_1 * i));
} else {
tmp = 2.0 * (((x * y) + (z * t)) - (i * (a * c)));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = a + (b * c)
t_2 = (c * t_1) * i
if ((t_2 <= (-5d+227)) .or. (.not. (t_2 <= 2d+277))) then
tmp = (-2.0d0) * (c * (t_1 * i))
else
tmp = 2.0d0 * (((x * y) + (z * t)) - (i * (a * c)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = a + (b * c);
double t_2 = (c * t_1) * i;
double tmp;
if ((t_2 <= -5e+227) || !(t_2 <= 2e+277)) {
tmp = -2.0 * (c * (t_1 * i));
} else {
tmp = 2.0 * (((x * y) + (z * t)) - (i * (a * c)));
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = a + (b * c) t_2 = (c * t_1) * i tmp = 0 if (t_2 <= -5e+227) or not (t_2 <= 2e+277): tmp = -2.0 * (c * (t_1 * i)) else: tmp = 2.0 * (((x * y) + (z * t)) - (i * (a * c))) return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(a + Float64(b * c)) t_2 = Float64(Float64(c * t_1) * i) tmp = 0.0 if ((t_2 <= -5e+227) || !(t_2 <= 2e+277)) tmp = Float64(-2.0 * Float64(c * Float64(t_1 * i))); else tmp = Float64(2.0 * Float64(Float64(Float64(x * y) + Float64(z * t)) - Float64(i * Float64(a * c)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = a + (b * c); t_2 = (c * t_1) * i; tmp = 0.0; if ((t_2 <= -5e+227) || ~((t_2 <= 2e+277))) tmp = -2.0 * (c * (t_1 * i)); else tmp = 2.0 * (((x * y) + (z * t)) - (i * (a * c))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(c * t$95$1), $MachinePrecision] * i), $MachinePrecision]}, If[Or[LessEqual[t$95$2, -5e+227], N[Not[LessEqual[t$95$2, 2e+277]], $MachinePrecision]], N[(-2.0 * N[(c * N[(t$95$1 * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] - N[(i * N[(a * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a + b \cdot c\\
t_2 := \left(c \cdot t\_1\right) \cdot i\\
\mathbf{if}\;t\_2 \leq -5 \cdot 10^{+227} \lor \neg \left(t\_2 \leq 2 \cdot 10^{+277}\right):\\
\;\;\;\;-2 \cdot \left(c \cdot \left(t\_1 \cdot i\right)\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(\left(x \cdot y + z \cdot t\right) - i \cdot \left(a \cdot c\right)\right)\\
\end{array}
\end{array}
if (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < -4.9999999999999996e227 or 2.00000000000000001e277 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) Initial program 66.9%
associate--l+66.9%
*-commutative66.9%
associate--l+66.9%
associate--l+66.9%
*-commutative66.9%
associate--l+66.9%
fma-define66.9%
*-commutative66.9%
associate-*l*78.7%
+-commutative78.7%
fma-define78.7%
Simplified78.7%
Taylor expanded in i around inf 84.2%
if -4.9999999999999996e227 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 2.00000000000000001e277Initial program 97.4%
Taylor expanded in a around inf 91.7%
*-commutative91.7%
Simplified91.7%
Final simplification88.9%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ a (* b c))) (t_2 (+ (* x y) (* z t))))
(if (<= (- t_2 (* (* c t_1) i)) INFINITY)
(* 2.0 (- t_2 (* t_1 (* c i))))
(* -2.0 (* 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 = (x * y) + (z * t);
double tmp;
if ((t_2 - ((c * t_1) * i)) <= ((double) INFINITY)) {
tmp = 2.0 * (t_2 - (t_1 * (c * i)));
} else {
tmp = -2.0 * (c * (t_1 * i));
}
return tmp;
}
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = a + (b * c);
double t_2 = (x * y) + (z * t);
double tmp;
if ((t_2 - ((c * t_1) * i)) <= Double.POSITIVE_INFINITY) {
tmp = 2.0 * (t_2 - (t_1 * (c * i)));
} else {
tmp = -2.0 * (c * (t_1 * i));
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = a + (b * c) t_2 = (x * y) + (z * t) tmp = 0 if (t_2 - ((c * t_1) * i)) <= math.inf: tmp = 2.0 * (t_2 - (t_1 * (c * i))) else: tmp = -2.0 * (c * (t_1 * i)) return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(a + Float64(b * c)) t_2 = Float64(Float64(x * y) + Float64(z * t)) tmp = 0.0 if (Float64(t_2 - Float64(Float64(c * t_1) * i)) <= Inf) tmp = Float64(2.0 * Float64(t_2 - Float64(t_1 * Float64(c * i)))); else tmp = Float64(-2.0 * Float64(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 = (x * y) + (z * t); tmp = 0.0; if ((t_2 - ((c * t_1) * i)) <= Inf) tmp = 2.0 * (t_2 - (t_1 * (c * i))); else tmp = -2.0 * (c * (t_1 * i)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(t$95$2 - N[(N[(c * t$95$1), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision], Infinity], N[(2.0 * N[(t$95$2 - N[(t$95$1 * N[(c * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(-2.0 * N[(c * N[(t$95$1 * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a + b \cdot c\\
t_2 := x \cdot y + z \cdot t\\
\mathbf{if}\;t\_2 - \left(c \cdot t\_1\right) \cdot i \leq \infty:\\
\;\;\;\;2 \cdot \left(t\_2 - t\_1 \cdot \left(c \cdot i\right)\right)\\
\mathbf{else}:\\
\;\;\;\;-2 \cdot \left(c \cdot \left(t\_1 \cdot i\right)\right)\\
\end{array}
\end{array}
if (-.f64 (+.f64 (*.f64 x y) (*.f64 z t)) (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i)) < +inf.0Initial program 92.5%
fma-define92.5%
associate-*l*96.0%
Simplified96.0%
fma-define96.0%
+-commutative96.0%
Applied egg-rr96.0%
if +inf.0 < (-.f64 (+.f64 (*.f64 x y) (*.f64 z t)) (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i)) Initial program 0.0%
associate--l+0.0%
*-commutative0.0%
associate--l+0.0%
associate--l+0.0%
*-commutative0.0%
associate--l+0.0%
fma-define11.1%
*-commutative11.1%
associate-*l*22.2%
+-commutative22.2%
fma-define22.2%
Simplified22.2%
Taylor expanded in i around inf 55.8%
Final simplification93.2%
(FPCore (x y z t a b c i)
:precision binary64
(if (<= c -4.6e-41)
(* -2.0 (* c (* c (* b i))))
(if (<= c 7.6e-260)
(* x (* y 2.0))
(if (<= c 1.4e-54) (* t (* z 2.0)) (* -2.0 (* c (* b (* c i))))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (c <= -4.6e-41) {
tmp = -2.0 * (c * (c * (b * i)));
} else if (c <= 7.6e-260) {
tmp = x * (y * 2.0);
} else if (c <= 1.4e-54) {
tmp = t * (z * 2.0);
} else {
tmp = -2.0 * (c * (b * (c * i)));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: tmp
if (c <= (-4.6d-41)) then
tmp = (-2.0d0) * (c * (c * (b * i)))
else if (c <= 7.6d-260) then
tmp = x * (y * 2.0d0)
else if (c <= 1.4d-54) then
tmp = t * (z * 2.0d0)
else
tmp = (-2.0d0) * (c * (b * (c * i)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (c <= -4.6e-41) {
tmp = -2.0 * (c * (c * (b * i)));
} else if (c <= 7.6e-260) {
tmp = x * (y * 2.0);
} else if (c <= 1.4e-54) {
tmp = t * (z * 2.0);
} else {
tmp = -2.0 * (c * (b * (c * i)));
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if c <= -4.6e-41: tmp = -2.0 * (c * (c * (b * i))) elif c <= 7.6e-260: tmp = x * (y * 2.0) elif c <= 1.4e-54: tmp = t * (z * 2.0) else: tmp = -2.0 * (c * (b * (c * i))) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (c <= -4.6e-41) tmp = Float64(-2.0 * Float64(c * Float64(c * Float64(b * i)))); elseif (c <= 7.6e-260) tmp = Float64(x * Float64(y * 2.0)); elseif (c <= 1.4e-54) tmp = Float64(t * Float64(z * 2.0)); else tmp = Float64(-2.0 * Float64(c * Float64(b * Float64(c * i)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if (c <= -4.6e-41) tmp = -2.0 * (c * (c * (b * i))); elseif (c <= 7.6e-260) tmp = x * (y * 2.0); elseif (c <= 1.4e-54) tmp = t * (z * 2.0); else tmp = -2.0 * (c * (b * (c * i))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[c, -4.6e-41], N[(-2.0 * N[(c * N[(c * N[(b * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[c, 7.6e-260], N[(x * N[(y * 2.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[c, 1.4e-54], N[(t * N[(z * 2.0), $MachinePrecision]), $MachinePrecision], N[(-2.0 * N[(c * N[(b * N[(c * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;c \leq -4.6 \cdot 10^{-41}:\\
\;\;\;\;-2 \cdot \left(c \cdot \left(c \cdot \left(b \cdot i\right)\right)\right)\\
\mathbf{elif}\;c \leq 7.6 \cdot 10^{-260}:\\
\;\;\;\;x \cdot \left(y \cdot 2\right)\\
\mathbf{elif}\;c \leq 1.4 \cdot 10^{-54}:\\
\;\;\;\;t \cdot \left(z \cdot 2\right)\\
\mathbf{else}:\\
\;\;\;\;-2 \cdot \left(c \cdot \left(b \cdot \left(c \cdot i\right)\right)\right)\\
\end{array}
\end{array}
if c < -4.6000000000000002e-41Initial program 72.3%
associate--l+72.3%
*-commutative72.3%
associate--l+72.3%
associate--l+72.3%
*-commutative72.3%
associate--l+72.3%
fma-define74.0%
*-commutative74.0%
associate-*l*90.0%
+-commutative90.0%
fma-define90.0%
Simplified90.0%
Taylor expanded in i around inf 62.1%
Taylor expanded in a around 0 47.4%
associate-*r*47.4%
*-commutative47.4%
associate-*l*48.9%
*-commutative48.9%
Simplified48.9%
if -4.6000000000000002e-41 < c < 7.6000000000000006e-260Initial program 96.9%
associate--l+96.9%
*-commutative96.9%
associate--l+96.9%
associate--l+96.9%
*-commutative96.9%
associate--l+96.9%
fma-define98.4%
*-commutative98.4%
associate-*l*85.7%
+-commutative85.7%
fma-define85.7%
Simplified85.7%
Taylor expanded in x around inf 52.7%
*-commutative52.7%
associate-*l*52.7%
Simplified52.7%
if 7.6000000000000006e-260 < c < 1.4000000000000001e-54Initial program 99.9%
associate--l+99.9%
*-commutative99.9%
associate--l+99.9%
associate--l+99.9%
*-commutative99.9%
associate--l+99.9%
fma-define99.9%
*-commutative99.9%
associate-*l*85.7%
+-commutative85.7%
fma-define85.7%
Simplified85.7%
Taylor expanded in z around inf 53.1%
*-commutative53.1%
*-commutative53.1%
*-commutative53.1%
associate-*r*53.1%
Simplified53.1%
if 1.4000000000000001e-54 < c Initial program 78.9%
associate--l+78.9%
*-commutative78.9%
associate--l+78.9%
associate--l+78.9%
*-commutative78.9%
associate--l+78.9%
fma-define78.9%
*-commutative78.9%
associate-*l*84.5%
+-commutative84.5%
fma-define84.5%
Simplified84.5%
Taylor expanded in i around inf 70.7%
Taylor expanded in a around 0 53.9%
Final simplification52.3%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* -2.0 (* c (* b (* c i))))))
(if (<= c -1.95e-41)
t_1
(if (<= c 6.1e-260)
(* x (* y 2.0))
(if (<= c 3.1e-50) (* t (* z 2.0)) t_1)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = -2.0 * (c * (b * (c * i)));
double tmp;
if (c <= -1.95e-41) {
tmp = t_1;
} else if (c <= 6.1e-260) {
tmp = x * (y * 2.0);
} else if (c <= 3.1e-50) {
tmp = t * (z * 2.0);
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: t_1
real(8) :: tmp
t_1 = (-2.0d0) * (c * (b * (c * i)))
if (c <= (-1.95d-41)) then
tmp = t_1
else if (c <= 6.1d-260) then
tmp = x * (y * 2.0d0)
else if (c <= 3.1d-50) then
tmp = t * (z * 2.0d0)
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = -2.0 * (c * (b * (c * i)));
double tmp;
if (c <= -1.95e-41) {
tmp = t_1;
} else if (c <= 6.1e-260) {
tmp = x * (y * 2.0);
} else if (c <= 3.1e-50) {
tmp = t * (z * 2.0);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = -2.0 * (c * (b * (c * i))) tmp = 0 if c <= -1.95e-41: tmp = t_1 elif c <= 6.1e-260: tmp = x * (y * 2.0) elif c <= 3.1e-50: tmp = t * (z * 2.0) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(-2.0 * Float64(c * Float64(b * Float64(c * i)))) tmp = 0.0 if (c <= -1.95e-41) tmp = t_1; elseif (c <= 6.1e-260) tmp = Float64(x * Float64(y * 2.0)); elseif (c <= 3.1e-50) tmp = Float64(t * Float64(z * 2.0)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = -2.0 * (c * (b * (c * i))); tmp = 0.0; if (c <= -1.95e-41) tmp = t_1; elseif (c <= 6.1e-260) tmp = x * (y * 2.0); elseif (c <= 3.1e-50) tmp = t * (z * 2.0); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(-2.0 * N[(c * N[(b * N[(c * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[c, -1.95e-41], t$95$1, If[LessEqual[c, 6.1e-260], N[(x * N[(y * 2.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[c, 3.1e-50], N[(t * N[(z * 2.0), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := -2 \cdot \left(c \cdot \left(b \cdot \left(c \cdot i\right)\right)\right)\\
\mathbf{if}\;c \leq -1.95 \cdot 10^{-41}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;c \leq 6.1 \cdot 10^{-260}:\\
\;\;\;\;x \cdot \left(y \cdot 2\right)\\
\mathbf{elif}\;c \leq 3.1 \cdot 10^{-50}:\\
\;\;\;\;t \cdot \left(z \cdot 2\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if c < -1.94999999999999995e-41 or 3.1000000000000002e-50 < c Initial program 76.2%
associate--l+76.2%
*-commutative76.2%
associate--l+76.2%
associate--l+76.2%
*-commutative76.2%
associate--l+76.2%
fma-define76.9%
*-commutative76.9%
associate-*l*86.8%
+-commutative86.8%
fma-define86.8%
Simplified86.8%
Taylor expanded in i around inf 67.1%
Taylor expanded in a around 0 51.2%
if -1.94999999999999995e-41 < c < 6.1000000000000003e-260Initial program 96.9%
associate--l+96.9%
*-commutative96.9%
associate--l+96.9%
associate--l+96.9%
*-commutative96.9%
associate--l+96.9%
fma-define98.4%
*-commutative98.4%
associate-*l*85.7%
+-commutative85.7%
fma-define85.7%
Simplified85.7%
Taylor expanded in x around inf 52.7%
*-commutative52.7%
associate-*l*52.7%
Simplified52.7%
if 6.1000000000000003e-260 < c < 3.1000000000000002e-50Initial program 99.9%
associate--l+99.9%
*-commutative99.9%
associate--l+99.9%
associate--l+99.9%
*-commutative99.9%
associate--l+99.9%
fma-define99.9%
*-commutative99.9%
associate-*l*85.7%
+-commutative85.7%
fma-define85.7%
Simplified85.7%
Taylor expanded in z around inf 53.1%
*-commutative53.1%
*-commutative53.1%
*-commutative53.1%
associate-*r*53.1%
Simplified53.1%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* x (* y 2.0))))
(if (<= y -2.3)
t_1
(if (<= y 4.6e-59)
(* t (* z 2.0))
(if (<= y 3.7e+40) (* -2.0 (* a (* c i))) 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 (y <= -2.3) {
tmp = t_1;
} else if (y <= 4.6e-59) {
tmp = t * (z * 2.0);
} else if (y <= 3.7e+40) {
tmp = -2.0 * (a * (c * i));
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: t_1
real(8) :: tmp
t_1 = x * (y * 2.0d0)
if (y <= (-2.3d0)) then
tmp = t_1
else if (y <= 4.6d-59) then
tmp = t * (z * 2.0d0)
else if (y <= 3.7d+40) then
tmp = (-2.0d0) * (a * (c * i))
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = x * (y * 2.0);
double tmp;
if (y <= -2.3) {
tmp = t_1;
} else if (y <= 4.6e-59) {
tmp = t * (z * 2.0);
} else if (y <= 3.7e+40) {
tmp = -2.0 * (a * (c * i));
} 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 y <= -2.3: tmp = t_1 elif y <= 4.6e-59: tmp = t * (z * 2.0) elif y <= 3.7e+40: tmp = -2.0 * (a * (c * i)) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(x * Float64(y * 2.0)) tmp = 0.0 if (y <= -2.3) tmp = t_1; elseif (y <= 4.6e-59) tmp = Float64(t * Float64(z * 2.0)); elseif (y <= 3.7e+40) tmp = Float64(-2.0 * Float64(a * Float64(c * i))); 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 (y <= -2.3) tmp = t_1; elseif (y <= 4.6e-59) tmp = t * (z * 2.0); elseif (y <= 3.7e+40) tmp = -2.0 * (a * (c * i)); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(x * N[(y * 2.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -2.3], t$95$1, If[LessEqual[y, 4.6e-59], N[(t * N[(z * 2.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 3.7e+40], N[(-2.0 * N[(a * N[(c * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \left(y \cdot 2\right)\\
\mathbf{if}\;y \leq -2.3:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 4.6 \cdot 10^{-59}:\\
\;\;\;\;t \cdot \left(z \cdot 2\right)\\
\mathbf{elif}\;y \leq 3.7 \cdot 10^{+40}:\\
\;\;\;\;-2 \cdot \left(a \cdot \left(c \cdot i\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -2.2999999999999998 or 3.7e40 < y Initial program 80.0%
associate--l+80.0%
*-commutative80.0%
associate--l+80.0%
associate--l+80.0%
*-commutative80.0%
associate--l+80.0%
fma-define81.6%
*-commutative81.6%
associate-*l*82.2%
+-commutative82.2%
fma-define82.2%
Simplified82.2%
Taylor expanded in x around inf 49.9%
*-commutative49.9%
associate-*l*49.9%
Simplified49.9%
if -2.2999999999999998 < y < 4.59999999999999959e-59Initial program 92.1%
associate--l+92.1%
*-commutative92.1%
associate--l+92.1%
associate--l+92.1%
*-commutative92.1%
associate--l+92.1%
fma-define92.1%
*-commutative92.1%
associate-*l*89.5%
+-commutative89.5%
fma-define89.5%
Simplified89.5%
Taylor expanded in z around inf 39.9%
*-commutative39.9%
*-commutative39.9%
*-commutative39.9%
associate-*r*39.9%
Simplified39.9%
if 4.59999999999999959e-59 < y < 3.7e40Initial program 90.1%
associate--l+90.1%
*-commutative90.1%
associate--l+90.1%
associate--l+90.1%
*-commutative90.1%
associate--l+90.1%
fma-define90.1%
*-commutative90.1%
associate-*l*95.4%
+-commutative95.4%
fma-define95.4%
Simplified95.4%
Taylor expanded in a around inf 28.2%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= c -4.9e+122) (not (<= c 2.7e-50))) (* -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 <= -4.9e+122) || !(c <= 2.7e-50)) {
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 <= (-4.9d+122)) .or. (.not. (c <= 2.7d-50))) 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 <= -4.9e+122) || !(c <= 2.7e-50)) {
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 <= -4.9e+122) or not (c <= 2.7e-50): 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 <= -4.9e+122) || !(c <= 2.7e-50)) tmp = Float64(-2.0 * Float64(c * Float64(Float64(a + Float64(b * c)) * i))); else tmp = Float64(Float64(Float64(x * y) + Float64(z * t)) * 2.0); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if ((c <= -4.9e+122) || ~((c <= 2.7e-50))) 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, -4.9e+122], N[Not[LessEqual[c, 2.7e-50]], $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 -4.9 \cdot 10^{+122} \lor \neg \left(c \leq 2.7 \cdot 10^{-50}\right):\\
\;\;\;\;-2 \cdot \left(c \cdot \left(\left(a + b \cdot c\right) \cdot i\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(x \cdot y + z \cdot t\right) \cdot 2\\
\end{array}
\end{array}
if c < -4.8999999999999998e122 or 2.7e-50 < c Initial program 75.2%
associate--l+75.2%
*-commutative75.2%
associate--l+75.2%
associate--l+75.2%
*-commutative75.2%
associate--l+75.2%
fma-define75.2%
*-commutative75.2%
associate-*l*85.4%
+-commutative85.4%
fma-define85.4%
Simplified85.4%
Taylor expanded in i around inf 73.2%
if -4.8999999999999998e122 < c < 2.7e-50Initial program 93.9%
associate--l+93.9%
*-commutative93.9%
associate--l+93.9%
associate--l+93.9%
*-commutative93.9%
associate--l+93.9%
fma-define95.3%
*-commutative95.3%
associate-*l*87.0%
+-commutative87.0%
fma-define87.0%
Simplified87.0%
Taylor expanded in c around 0 74.8%
Final simplification74.1%
(FPCore (x y z t a b c i)
:precision binary64
(if (<= c -2.05e+80)
(* -2.0 (* c (* c (* b i))))
(if (<= c 5.6e-15)
(* (+ (* x y) (* z t)) 2.0)
(* -2.0 (* c (* b (* c i)))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (c <= -2.05e+80) {
tmp = -2.0 * (c * (c * (b * i)));
} else if (c <= 5.6e-15) {
tmp = ((x * y) + (z * t)) * 2.0;
} else {
tmp = -2.0 * (c * (b * (c * i)));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: tmp
if (c <= (-2.05d+80)) then
tmp = (-2.0d0) * (c * (c * (b * i)))
else if (c <= 5.6d-15) then
tmp = ((x * y) + (z * t)) * 2.0d0
else
tmp = (-2.0d0) * (c * (b * (c * i)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (c <= -2.05e+80) {
tmp = -2.0 * (c * (c * (b * i)));
} else if (c <= 5.6e-15) {
tmp = ((x * y) + (z * t)) * 2.0;
} else {
tmp = -2.0 * (c * (b * (c * i)));
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if c <= -2.05e+80: tmp = -2.0 * (c * (c * (b * i))) elif c <= 5.6e-15: tmp = ((x * y) + (z * t)) * 2.0 else: tmp = -2.0 * (c * (b * (c * i))) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (c <= -2.05e+80) tmp = Float64(-2.0 * Float64(c * Float64(c * Float64(b * i)))); elseif (c <= 5.6e-15) tmp = Float64(Float64(Float64(x * y) + Float64(z * t)) * 2.0); else tmp = Float64(-2.0 * Float64(c * Float64(b * Float64(c * i)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if (c <= -2.05e+80) tmp = -2.0 * (c * (c * (b * i))); elseif (c <= 5.6e-15) tmp = ((x * y) + (z * t)) * 2.0; else tmp = -2.0 * (c * (b * (c * i))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[c, -2.05e+80], N[(-2.0 * N[(c * N[(c * N[(b * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[c, 5.6e-15], N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision], N[(-2.0 * N[(c * N[(b * N[(c * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;c \leq -2.05 \cdot 10^{+80}:\\
\;\;\;\;-2 \cdot \left(c \cdot \left(c \cdot \left(b \cdot i\right)\right)\right)\\
\mathbf{elif}\;c \leq 5.6 \cdot 10^{-15}:\\
\;\;\;\;\left(x \cdot y + z \cdot t\right) \cdot 2\\
\mathbf{else}:\\
\;\;\;\;-2 \cdot \left(c \cdot \left(b \cdot \left(c \cdot i\right)\right)\right)\\
\end{array}
\end{array}
if c < -2.05000000000000001e80Initial program 58.9%
associate--l+58.9%
*-commutative58.9%
associate--l+58.9%
associate--l+58.9%
*-commutative58.9%
associate--l+58.9%
fma-define58.9%
*-commutative58.9%
associate-*l*83.8%
+-commutative83.8%
fma-define83.8%
Simplified83.8%
Taylor expanded in i around inf 71.3%
Taylor expanded in a around 0 61.2%
associate-*r*58.1%
*-commutative58.1%
associate-*l*64.1%
*-commutative64.1%
Simplified64.1%
if -2.05000000000000001e80 < c < 5.60000000000000028e-15Initial program 95.9%
associate--l+95.9%
*-commutative95.9%
associate--l+95.9%
associate--l+95.9%
*-commutative95.9%
associate--l+95.9%
fma-define97.2%
*-commutative97.2%
associate-*l*88.3%
+-commutative88.3%
fma-define88.3%
Simplified88.3%
Taylor expanded in c around 0 74.3%
if 5.60000000000000028e-15 < c Initial program 77.6%
associate--l+77.6%
*-commutative77.6%
associate--l+77.6%
associate--l+77.6%
*-commutative77.6%
associate--l+77.6%
fma-define77.6%
*-commutative77.6%
associate-*l*83.5%
+-commutative83.5%
fma-define83.5%
Simplified83.5%
Taylor expanded in i around inf 71.3%
Taylor expanded in a around 0 55.9%
Final simplification67.5%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= y -5.8e-8) (not (<= y 1.05e+37))) (* x (* y 2.0)) (* t (* z 2.0))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((y <= -5.8e-8) || !(y <= 1.05e+37)) {
tmp = x * (y * 2.0);
} else {
tmp = t * (z * 2.0);
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: tmp
if ((y <= (-5.8d-8)) .or. (.not. (y <= 1.05d+37))) then
tmp = x * (y * 2.0d0)
else
tmp = t * (z * 2.0d0)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((y <= -5.8e-8) || !(y <= 1.05e+37)) {
tmp = x * (y * 2.0);
} else {
tmp = t * (z * 2.0);
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if (y <= -5.8e-8) or not (y <= 1.05e+37): tmp = x * (y * 2.0) else: tmp = t * (z * 2.0) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if ((y <= -5.8e-8) || !(y <= 1.05e+37)) tmp = Float64(x * Float64(y * 2.0)); else tmp = Float64(t * Float64(z * 2.0)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if ((y <= -5.8e-8) || ~((y <= 1.05e+37))) tmp = x * (y * 2.0); else tmp = t * (z * 2.0); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[y, -5.8e-8], N[Not[LessEqual[y, 1.05e+37]], $MachinePrecision]], N[(x * N[(y * 2.0), $MachinePrecision]), $MachinePrecision], N[(t * N[(z * 2.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -5.8 \cdot 10^{-8} \lor \neg \left(y \leq 1.05 \cdot 10^{+37}\right):\\
\;\;\;\;x \cdot \left(y \cdot 2\right)\\
\mathbf{else}:\\
\;\;\;\;t \cdot \left(z \cdot 2\right)\\
\end{array}
\end{array}
if y < -5.8000000000000003e-8 or 1.0500000000000001e37 < y Initial program 80.3%
associate--l+80.3%
*-commutative80.3%
associate--l+80.3%
associate--l+80.3%
*-commutative80.3%
associate--l+80.3%
fma-define81.9%
*-commutative81.9%
associate-*l*81.7%
+-commutative81.7%
fma-define81.7%
Simplified81.7%
Taylor expanded in x around inf 49.2%
*-commutative49.2%
associate-*l*49.2%
Simplified49.2%
if -5.8000000000000003e-8 < y < 1.0500000000000001e37Initial program 91.7%
associate--l+91.7%
*-commutative91.7%
associate--l+91.7%
associate--l+91.7%
*-commutative91.7%
associate--l+91.7%
fma-define91.7%
*-commutative91.7%
associate-*l*91.0%
+-commutative91.0%
fma-define91.0%
Simplified91.0%
Taylor expanded in z around inf 37.2%
*-commutative37.2%
*-commutative37.2%
*-commutative37.2%
associate-*r*37.2%
Simplified37.2%
Final simplification43.2%
(FPCore (x y z t a b c i) :precision binary64 (* t (* z 2.0)))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return t * (z * 2.0);
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
code = t * (z * 2.0d0)
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return t * (z * 2.0);
}
def code(x, y, z, t, a, b, c, i): return t * (z * 2.0)
function code(x, y, z, t, a, b, c, i) return Float64(t * Float64(z * 2.0)) end
function tmp = code(x, y, z, t, a, b, c, i) tmp = t * (z * 2.0); end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(t * N[(z * 2.0), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
t \cdot \left(z \cdot 2\right)
\end{array}
Initial program 86.0%
associate--l+86.0%
*-commutative86.0%
associate--l+86.0%
associate--l+86.0%
*-commutative86.0%
associate--l+86.0%
fma-define86.7%
*-commutative86.7%
associate-*l*86.3%
+-commutative86.3%
fma-define86.3%
Simplified86.3%
Taylor expanded in z around inf 28.6%
*-commutative28.6%
*-commutative28.6%
*-commutative28.6%
associate-*r*28.6%
Simplified28.6%
(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 2024125
(FPCore (x y z t a b c i)
:name "Diagrams.ThreeD.Shapes:frustum from diagrams-lib-1.3.0.3, A"
:precision binary64
:alt
(! :herbie-platform default (* 2 (- (+ (* x y) (* z t)) (* (+ a (* b c)) (* c i)))))
(* 2.0 (- (+ (* x y) (* z t)) (* (* (+ a (* b c)) c) i))))