
(FPCore (x y z t a b c i) :precision binary64 (* 2.0 (- (+ (* x y) (* z t)) (* (* (+ a (* b c)) c) i))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return 2.0 * (((x * y) + (z * t)) - (((a + (b * c)) * c) * i));
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
code = 2.0d0 * (((x * y) + (z * t)) - (((a + (b * c)) * c) * i))
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return 2.0 * (((x * y) + (z * t)) - (((a + (b * c)) * c) * i));
}
def code(x, y, z, t, a, b, c, i): return 2.0 * (((x * y) + (z * t)) - (((a + (b * c)) * c) * i))
function code(x, y, z, t, a, b, c, i) return Float64(2.0 * Float64(Float64(Float64(x * y) + Float64(z * t)) - Float64(Float64(Float64(a + Float64(b * c)) * c) * i))) end
function tmp = code(x, y, z, t, a, b, c, i) tmp = 2.0 * (((x * y) + (z * t)) - (((a + (b * c)) * c) * i)); end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(2.0 * N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] - N[(N[(N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision] * c), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
2 \cdot \left(\left(x \cdot y + z \cdot t\right) - \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i\right)
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 13 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a b c i) :precision binary64 (* 2.0 (- (+ (* x y) (* z t)) (* (* (+ a (* b c)) c) i))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return 2.0 * (((x * y) + (z * t)) - (((a + (b * c)) * c) * i));
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
code = 2.0d0 * (((x * y) + (z * t)) - (((a + (b * c)) * c) * i))
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return 2.0 * (((x * y) + (z * t)) - (((a + (b * c)) * c) * i));
}
def code(x, y, z, t, a, b, c, i): return 2.0 * (((x * y) + (z * t)) - (((a + (b * c)) * c) * i))
function code(x, y, z, t, a, b, c, i) return Float64(2.0 * Float64(Float64(Float64(x * y) + Float64(z * t)) - Float64(Float64(Float64(a + Float64(b * c)) * c) * i))) end
function tmp = code(x, y, z, t, a, b, c, i) tmp = 2.0 * (((x * y) + (z * t)) - (((a + (b * c)) * c) * i)); end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(2.0 * N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] - N[(N[(N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision] * c), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
2 \cdot \left(\left(x \cdot y + z \cdot t\right) - \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i\right)
\end{array}
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ a (* b c))))
(if (<= (- (+ (* x y) (* z t)) (* (* c t_1) i)) INFINITY)
(* 2.0 (- (fma x y (* z t)) (* 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 tmp;
if ((((x * y) + (z * t)) - ((c * t_1) * i)) <= ((double) INFINITY)) {
tmp = 2.0 * (fma(x, y, (z * t)) - (t_1 * (c * i)));
} else {
tmp = 2.0 * (c * (t_1 * -i));
}
return tmp;
}
function code(x, y, z, t, a, b, c, i) t_1 = Float64(a + Float64(b * c)) tmp = 0.0 if (Float64(Float64(Float64(x * y) + Float64(z * t)) - Float64(Float64(c * t_1) * i)) <= Inf) tmp = Float64(2.0 * Float64(fma(x, y, Float64(z * t)) - Float64(t_1 * Float64(c * i)))); else tmp = Float64(2.0 * Float64(c * Float64(t_1 * Float64(-i)))); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] - N[(N[(c * t$95$1), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision], Infinity], N[(2.0 * N[(N[(x * y + N[(z * t), $MachinePrecision]), $MachinePrecision] - N[(t$95$1 * N[(c * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(c * N[(t$95$1 * (-i)), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a + b \cdot c\\
\mathbf{if}\;\left(x \cdot y + z \cdot t\right) - \left(c \cdot t_1\right) \cdot i \leq \infty:\\
\;\;\;\;2 \cdot \left(\mathsf{fma}\left(x, y, z \cdot t\right) - t_1 \cdot \left(c \cdot i\right)\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(c \cdot \left(t_1 \cdot \left(-i\right)\right)\right)\\
\end{array}
\end{array}
if (-.f64 (+.f64 (*.f64 x y) (*.f64 z t)) (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i)) < +inf.0Initial program 95.6%
associate-*l*98.7%
fma-def98.7%
Simplified98.7%
if +inf.0 < (-.f64 (+.f64 (*.f64 x y) (*.f64 z t)) (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i)) Initial program 0.0%
Taylor expanded in i around inf 80.3%
Final simplification97.6%
(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 (- INFINITY)) (not (<= t_2 5e+290)))
(* 2.0 (* c (* t_1 (- i))))
(* (- (+ (* x y) (* z t)) t_2) 2.0))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = a + (b * c);
double t_2 = (c * t_1) * i;
double tmp;
if ((t_2 <= -((double) INFINITY)) || !(t_2 <= 5e+290)) {
tmp = 2.0 * (c * (t_1 * -i));
} else {
tmp = (((x * y) + (z * t)) - t_2) * 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) * i;
double tmp;
if ((t_2 <= -Double.POSITIVE_INFINITY) || !(t_2 <= 5e+290)) {
tmp = 2.0 * (c * (t_1 * -i));
} else {
tmp = (((x * y) + (z * t)) - t_2) * 2.0;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = a + (b * c) t_2 = (c * t_1) * i tmp = 0 if (t_2 <= -math.inf) or not (t_2 <= 5e+290): tmp = 2.0 * (c * (t_1 * -i)) else: tmp = (((x * y) + (z * t)) - t_2) * 2.0 return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(a + Float64(b * c)) t_2 = Float64(Float64(c * t_1) * i) tmp = 0.0 if ((t_2 <= Float64(-Inf)) || !(t_2 <= 5e+290)) tmp = Float64(2.0 * Float64(c * Float64(t_1 * Float64(-i)))); else tmp = Float64(Float64(Float64(Float64(x * y) + Float64(z * t)) - t_2) * 2.0); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = a + (b * c); t_2 = (c * t_1) * i; tmp = 0.0; if ((t_2 <= -Inf) || ~((t_2 <= 5e+290))) tmp = 2.0 * (c * (t_1 * -i)); else tmp = (((x * y) + (z * t)) - t_2) * 2.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(c * t$95$1), $MachinePrecision] * i), $MachinePrecision]}, If[Or[LessEqual[t$95$2, (-Infinity)], N[Not[LessEqual[t$95$2, 5e+290]], $MachinePrecision]], N[(2.0 * N[(c * N[(t$95$1 * (-i)), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] - t$95$2), $MachinePrecision] * 2.0), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a + b \cdot c\\
t_2 := \left(c \cdot t_1\right) \cdot i\\
\mathbf{if}\;t_2 \leq -\infty \lor \neg \left(t_2 \leq 5 \cdot 10^{+290}\right):\\
\;\;\;\;2 \cdot \left(c \cdot \left(t_1 \cdot \left(-i\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\left(x \cdot y + z \cdot t\right) - t_2\right) \cdot 2\\
\end{array}
\end{array}
if (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < -inf.0 or 4.9999999999999998e290 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) Initial program 75.7%
Taylor expanded in i around inf 94.2%
if -inf.0 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 4.9999999999999998e290Initial program 99.2%
Final simplification97.3%
(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 * Float64(-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 \left(-i\right)\right)\right)\\
\end{array}
\end{array}
if (-.f64 (+.f64 (*.f64 x y) (*.f64 z t)) (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i)) < +inf.0Initial program 95.6%
associate-*l*98.7%
fma-def98.7%
Simplified98.7%
fma-def98.7%
+-commutative98.7%
Applied egg-rr98.7%
if +inf.0 < (-.f64 (+.f64 (*.f64 x y) (*.f64 z t)) (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i)) Initial program 0.0%
Taylor expanded in i around inf 80.3%
Final simplification97.6%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ (* x y) (* z t))) (t_2 (* 2.0 (* c (* (+ a (* b c)) (- i))))))
(if (<= c -1.2e+122)
t_2
(if (<= c 22500.0)
(* 2.0 (- t_1 (* i (* a c))))
(if (<= c 1.5e+186) (* 2.0 (- t_1 (* c (* b (* 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 = (x * y) + (z * t);
double t_2 = 2.0 * (c * ((a + (b * c)) * -i));
double tmp;
if (c <= -1.2e+122) {
tmp = t_2;
} else if (c <= 22500.0) {
tmp = 2.0 * (t_1 - (i * (a * c)));
} else if (c <= 1.5e+186) {
tmp = 2.0 * (t_1 - (c * (b * (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 = (x * y) + (z * t)
t_2 = 2.0d0 * (c * ((a + (b * c)) * -i))
if (c <= (-1.2d+122)) then
tmp = t_2
else if (c <= 22500.0d0) then
tmp = 2.0d0 * (t_1 - (i * (a * c)))
else if (c <= 1.5d+186) then
tmp = 2.0d0 * (t_1 - (c * (b * (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 = (x * y) + (z * t);
double t_2 = 2.0 * (c * ((a + (b * c)) * -i));
double tmp;
if (c <= -1.2e+122) {
tmp = t_2;
} else if (c <= 22500.0) {
tmp = 2.0 * (t_1 - (i * (a * c)));
} else if (c <= 1.5e+186) {
tmp = 2.0 * (t_1 - (c * (b * (c * i))));
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = (x * y) + (z * t) t_2 = 2.0 * (c * ((a + (b * c)) * -i)) tmp = 0 if c <= -1.2e+122: tmp = t_2 elif c <= 22500.0: tmp = 2.0 * (t_1 - (i * (a * c))) elif c <= 1.5e+186: tmp = 2.0 * (t_1 - (c * (b * (c * i)))) else: tmp = t_2 return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(Float64(x * y) + Float64(z * t)) t_2 = Float64(2.0 * Float64(c * Float64(Float64(a + Float64(b * c)) * Float64(-i)))) tmp = 0.0 if (c <= -1.2e+122) tmp = t_2; elseif (c <= 22500.0) tmp = Float64(2.0 * Float64(t_1 - Float64(i * Float64(a * c)))); elseif (c <= 1.5e+186) tmp = Float64(2.0 * Float64(t_1 - Float64(c * Float64(b * Float64(c * i))))); else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = (x * y) + (z * t); t_2 = 2.0 * (c * ((a + (b * c)) * -i)); tmp = 0.0; if (c <= -1.2e+122) tmp = t_2; elseif (c <= 22500.0) tmp = 2.0 * (t_1 - (i * (a * c))); elseif (c <= 1.5e+186) tmp = 2.0 * (t_1 - (c * (b * (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[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(2.0 * N[(c * N[(N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision] * (-i)), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[c, -1.2e+122], t$95$2, If[LessEqual[c, 22500.0], N[(2.0 * N[(t$95$1 - N[(i * N[(a * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[c, 1.5e+186], N[(2.0 * N[(t$95$1 - N[(c * N[(b * N[(c * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$2]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot y + z \cdot t\\
t_2 := 2 \cdot \left(c \cdot \left(\left(a + b \cdot c\right) \cdot \left(-i\right)\right)\right)\\
\mathbf{if}\;c \leq -1.2 \cdot 10^{+122}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;c \leq 22500:\\
\;\;\;\;2 \cdot \left(t_1 - i \cdot \left(a \cdot c\right)\right)\\
\mathbf{elif}\;c \leq 1.5 \cdot 10^{+186}:\\
\;\;\;\;2 \cdot \left(t_1 - c \cdot \left(b \cdot \left(c \cdot i\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if c < -1.2000000000000001e122 or 1.49999999999999991e186 < c Initial program 71.7%
Taylor expanded in i around inf 92.6%
if -1.2000000000000001e122 < c < 22500Initial program 98.6%
Taylor expanded in a around inf 91.8%
if 22500 < c < 1.49999999999999991e186Initial program 89.3%
Taylor expanded in a around 0 82.8%
expm1-log1p-u42.1%
expm1-udef42.1%
associate-*l*42.4%
*-commutative42.4%
Applied egg-rr42.4%
expm1-def42.4%
expm1-log1p83.1%
*-commutative83.1%
associate-*r*85.2%
*-commutative85.2%
*-commutative85.2%
Simplified85.2%
Final simplification90.8%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ (* x y) (* z t))) (t_2 (* 2.0 (* c (* (+ a (* b c)) (- i))))))
(if (<= c -6.8e+124)
t_2
(if (<= c 11200.0)
(* 2.0 (- t_1 (* i (* a c))))
(if (<= c 1.04e+186) (* 2.0 (- t_1 (* c (* c (* b i))))) t_2)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = (x * y) + (z * t);
double t_2 = 2.0 * (c * ((a + (b * c)) * -i));
double tmp;
if (c <= -6.8e+124) {
tmp = t_2;
} else if (c <= 11200.0) {
tmp = 2.0 * (t_1 - (i * (a * c)));
} else if (c <= 1.04e+186) {
tmp = 2.0 * (t_1 - (c * (c * (b * 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 = (x * y) + (z * t)
t_2 = 2.0d0 * (c * ((a + (b * c)) * -i))
if (c <= (-6.8d+124)) then
tmp = t_2
else if (c <= 11200.0d0) then
tmp = 2.0d0 * (t_1 - (i * (a * c)))
else if (c <= 1.04d+186) then
tmp = 2.0d0 * (t_1 - (c * (c * (b * 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 = (x * y) + (z * t);
double t_2 = 2.0 * (c * ((a + (b * c)) * -i));
double tmp;
if (c <= -6.8e+124) {
tmp = t_2;
} else if (c <= 11200.0) {
tmp = 2.0 * (t_1 - (i * (a * c)));
} else if (c <= 1.04e+186) {
tmp = 2.0 * (t_1 - (c * (c * (b * i))));
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = (x * y) + (z * t) t_2 = 2.0 * (c * ((a + (b * c)) * -i)) tmp = 0 if c <= -6.8e+124: tmp = t_2 elif c <= 11200.0: tmp = 2.0 * (t_1 - (i * (a * c))) elif c <= 1.04e+186: tmp = 2.0 * (t_1 - (c * (c * (b * i)))) else: tmp = t_2 return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(Float64(x * y) + Float64(z * t)) t_2 = Float64(2.0 * Float64(c * Float64(Float64(a + Float64(b * c)) * Float64(-i)))) tmp = 0.0 if (c <= -6.8e+124) tmp = t_2; elseif (c <= 11200.0) tmp = Float64(2.0 * Float64(t_1 - Float64(i * Float64(a * c)))); elseif (c <= 1.04e+186) tmp = Float64(2.0 * Float64(t_1 - Float64(c * Float64(c * Float64(b * i))))); else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = (x * y) + (z * t); t_2 = 2.0 * (c * ((a + (b * c)) * -i)); tmp = 0.0; if (c <= -6.8e+124) tmp = t_2; elseif (c <= 11200.0) tmp = 2.0 * (t_1 - (i * (a * c))); elseif (c <= 1.04e+186) tmp = 2.0 * (t_1 - (c * (c * (b * i)))); else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(2.0 * N[(c * N[(N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision] * (-i)), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[c, -6.8e+124], t$95$2, If[LessEqual[c, 11200.0], N[(2.0 * N[(t$95$1 - N[(i * N[(a * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[c, 1.04e+186], N[(2.0 * N[(t$95$1 - N[(c * N[(c * N[(b * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$2]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot y + z \cdot t\\
t_2 := 2 \cdot \left(c \cdot \left(\left(a + b \cdot c\right) \cdot \left(-i\right)\right)\right)\\
\mathbf{if}\;c \leq -6.8 \cdot 10^{+124}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;c \leq 11200:\\
\;\;\;\;2 \cdot \left(t_1 - i \cdot \left(a \cdot c\right)\right)\\
\mathbf{elif}\;c \leq 1.04 \cdot 10^{+186}:\\
\;\;\;\;2 \cdot \left(t_1 - c \cdot \left(c \cdot \left(b \cdot i\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if c < -6.8e124 or 1.04e186 < c Initial program 71.7%
Taylor expanded in i around inf 92.6%
if -6.8e124 < c < 11200Initial program 98.6%
Taylor expanded in a around inf 91.8%
if 11200 < c < 1.04e186Initial program 89.3%
Taylor expanded in a around 0 82.9%
unpow282.9%
associate-*r*87.2%
Simplified87.2%
Final simplification91.2%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* (+ (* x y) (* z t)) 2.0))
(t_2 (* 2.0 (* c (* (+ a (* b c)) (- i))))))
(if (<= c -1.95e+48)
t_2
(if (<= c -2e-37)
t_1
(if (<= c -5.4e-53)
t_2
(if (<= c -9e-75)
(* 2.0 (- (* z t) (* i (* a c))))
(if (<= c 2.7e-13) t_1 t_2)))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = ((x * y) + (z * t)) * 2.0;
double t_2 = 2.0 * (c * ((a + (b * c)) * -i));
double tmp;
if (c <= -1.95e+48) {
tmp = t_2;
} else if (c <= -2e-37) {
tmp = t_1;
} else if (c <= -5.4e-53) {
tmp = t_2;
} else if (c <= -9e-75) {
tmp = 2.0 * ((z * t) - (i * (a * c)));
} else if (c <= 2.7e-13) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = ((x * y) + (z * t)) * 2.0d0
t_2 = 2.0d0 * (c * ((a + (b * c)) * -i))
if (c <= (-1.95d+48)) then
tmp = t_2
else if (c <= (-2d-37)) then
tmp = t_1
else if (c <= (-5.4d-53)) then
tmp = t_2
else if (c <= (-9d-75)) then
tmp = 2.0d0 * ((z * t) - (i * (a * c)))
else if (c <= 2.7d-13) then
tmp = t_1
else
tmp = t_2
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = ((x * y) + (z * t)) * 2.0;
double t_2 = 2.0 * (c * ((a + (b * c)) * -i));
double tmp;
if (c <= -1.95e+48) {
tmp = t_2;
} else if (c <= -2e-37) {
tmp = t_1;
} else if (c <= -5.4e-53) {
tmp = t_2;
} else if (c <= -9e-75) {
tmp = 2.0 * ((z * t) - (i * (a * c)));
} else if (c <= 2.7e-13) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = ((x * y) + (z * t)) * 2.0 t_2 = 2.0 * (c * ((a + (b * c)) * -i)) tmp = 0 if c <= -1.95e+48: tmp = t_2 elif c <= -2e-37: tmp = t_1 elif c <= -5.4e-53: tmp = t_2 elif c <= -9e-75: tmp = 2.0 * ((z * t) - (i * (a * c))) elif c <= 2.7e-13: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(Float64(Float64(x * y) + Float64(z * t)) * 2.0) t_2 = Float64(2.0 * Float64(c * Float64(Float64(a + Float64(b * c)) * Float64(-i)))) tmp = 0.0 if (c <= -1.95e+48) tmp = t_2; elseif (c <= -2e-37) tmp = t_1; elseif (c <= -5.4e-53) tmp = t_2; elseif (c <= -9e-75) tmp = Float64(2.0 * Float64(Float64(z * t) - Float64(i * Float64(a * c)))); elseif (c <= 2.7e-13) tmp = t_1; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = ((x * y) + (z * t)) * 2.0; t_2 = 2.0 * (c * ((a + (b * c)) * -i)); tmp = 0.0; if (c <= -1.95e+48) tmp = t_2; elseif (c <= -2e-37) tmp = t_1; elseif (c <= -5.4e-53) tmp = t_2; elseif (c <= -9e-75) tmp = 2.0 * ((z * t) - (i * (a * c))); elseif (c <= 2.7e-13) tmp = t_1; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision]}, Block[{t$95$2 = N[(2.0 * N[(c * N[(N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision] * (-i)), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[c, -1.95e+48], t$95$2, If[LessEqual[c, -2e-37], t$95$1, If[LessEqual[c, -5.4e-53], t$95$2, If[LessEqual[c, -9e-75], N[(2.0 * N[(N[(z * t), $MachinePrecision] - N[(i * N[(a * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[c, 2.7e-13], t$95$1, t$95$2]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(x \cdot y + z \cdot t\right) \cdot 2\\
t_2 := 2 \cdot \left(c \cdot \left(\left(a + b \cdot c\right) \cdot \left(-i\right)\right)\right)\\
\mathbf{if}\;c \leq -1.95 \cdot 10^{+48}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;c \leq -2 \cdot 10^{-37}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;c \leq -5.4 \cdot 10^{-53}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;c \leq -9 \cdot 10^{-75}:\\
\;\;\;\;2 \cdot \left(z \cdot t - i \cdot \left(a \cdot c\right)\right)\\
\mathbf{elif}\;c \leq 2.7 \cdot 10^{-13}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if c < -1.95e48 or -2.00000000000000013e-37 < c < -5.3999999999999998e-53 or 2.70000000000000011e-13 < c Initial program 81.3%
Taylor expanded in i around inf 82.3%
if -1.95e48 < c < -2.00000000000000013e-37 or -9.0000000000000006e-75 < c < 2.70000000000000011e-13Initial program 99.1%
Taylor expanded in c around 0 77.9%
if -5.3999999999999998e-53 < c < -9.0000000000000006e-75Initial program 100.0%
Taylor expanded in a around inf 100.0%
Taylor expanded in x around 0 85.8%
associate-*r*85.8%
*-commutative85.8%
*-commutative85.8%
*-commutative85.8%
Simplified85.8%
Final simplification80.4%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= c -3e+122) (not (<= c 1e+41))) (* 2.0 (* c (* (+ a (* b c)) (- i)))) (* 2.0 (- (+ (* x y) (* z t)) (* i (* a c))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((c <= -3e+122) || !(c <= 1e+41)) {
tmp = 2.0 * (c * ((a + (b * c)) * -i));
} else {
tmp = 2.0 * (((x * y) + (z * t)) - (i * (a * c)));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: tmp
if ((c <= (-3d+122)) .or. (.not. (c <= 1d+41))) then
tmp = 2.0d0 * (c * ((a + (b * c)) * -i))
else
tmp = 2.0d0 * (((x * y) + (z * t)) - (i * (a * c)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((c <= -3e+122) || !(c <= 1e+41)) {
tmp = 2.0 * (c * ((a + (b * c)) * -i));
} else {
tmp = 2.0 * (((x * y) + (z * t)) - (i * (a * c)));
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if (c <= -3e+122) or not (c <= 1e+41): tmp = 2.0 * (c * ((a + (b * c)) * -i)) else: tmp = 2.0 * (((x * y) + (z * t)) - (i * (a * c))) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if ((c <= -3e+122) || !(c <= 1e+41)) tmp = Float64(2.0 * Float64(c * Float64(Float64(a + Float64(b * c)) * Float64(-i)))); else tmp = Float64(2.0 * Float64(Float64(Float64(x * y) + Float64(z * t)) - Float64(i * Float64(a * c)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if ((c <= -3e+122) || ~((c <= 1e+41))) tmp = 2.0 * (c * ((a + (b * c)) * -i)); else tmp = 2.0 * (((x * y) + (z * t)) - (i * (a * c))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[c, -3e+122], N[Not[LessEqual[c, 1e+41]], $MachinePrecision]], N[(2.0 * N[(c * N[(N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision] * (-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}
\mathbf{if}\;c \leq -3 \cdot 10^{+122} \lor \neg \left(c \leq 10^{+41}\right):\\
\;\;\;\;2 \cdot \left(c \cdot \left(\left(a + b \cdot c\right) \cdot \left(-i\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(\left(x \cdot y + z \cdot t\right) - i \cdot \left(a \cdot c\right)\right)\\
\end{array}
\end{array}
if c < -2.99999999999999986e122 or 1.00000000000000001e41 < c Initial program 76.8%
Taylor expanded in i around inf 84.8%
if -2.99999999999999986e122 < c < 1.00000000000000001e41Initial program 98.6%
Taylor expanded in a around inf 90.4%
Final simplification88.2%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* (+ (* x y) (* z t)) 2.0)) (t_2 (* c (* b (* (* c i) -2.0)))))
(if (<= c -3.25e+122)
t_2
(if (<= c -92000000000.0)
t_1
(if (<= c -8.8e-75)
(* 2.0 (- (* z t) (* i (* a c))))
(if (<= c 4.6e+41) t_1 t_2))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = ((x * y) + (z * t)) * 2.0;
double t_2 = c * (b * ((c * i) * -2.0));
double tmp;
if (c <= -3.25e+122) {
tmp = t_2;
} else if (c <= -92000000000.0) {
tmp = t_1;
} else if (c <= -8.8e-75) {
tmp = 2.0 * ((z * t) - (i * (a * c)));
} else if (c <= 4.6e+41) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = ((x * y) + (z * t)) * 2.0d0
t_2 = c * (b * ((c * i) * (-2.0d0)))
if (c <= (-3.25d+122)) then
tmp = t_2
else if (c <= (-92000000000.0d0)) then
tmp = t_1
else if (c <= (-8.8d-75)) then
tmp = 2.0d0 * ((z * t) - (i * (a * c)))
else if (c <= 4.6d+41) then
tmp = t_1
else
tmp = t_2
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = ((x * y) + (z * t)) * 2.0;
double t_2 = c * (b * ((c * i) * -2.0));
double tmp;
if (c <= -3.25e+122) {
tmp = t_2;
} else if (c <= -92000000000.0) {
tmp = t_1;
} else if (c <= -8.8e-75) {
tmp = 2.0 * ((z * t) - (i * (a * c)));
} else if (c <= 4.6e+41) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = ((x * y) + (z * t)) * 2.0 t_2 = c * (b * ((c * i) * -2.0)) tmp = 0 if c <= -3.25e+122: tmp = t_2 elif c <= -92000000000.0: tmp = t_1 elif c <= -8.8e-75: tmp = 2.0 * ((z * t) - (i * (a * c))) elif c <= 4.6e+41: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(Float64(Float64(x * y) + Float64(z * t)) * 2.0) t_2 = Float64(c * Float64(b * Float64(Float64(c * i) * -2.0))) tmp = 0.0 if (c <= -3.25e+122) tmp = t_2; elseif (c <= -92000000000.0) tmp = t_1; elseif (c <= -8.8e-75) tmp = Float64(2.0 * Float64(Float64(z * t) - Float64(i * Float64(a * c)))); elseif (c <= 4.6e+41) tmp = t_1; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = ((x * y) + (z * t)) * 2.0; t_2 = c * (b * ((c * i) * -2.0)); tmp = 0.0; if (c <= -3.25e+122) tmp = t_2; elseif (c <= -92000000000.0) tmp = t_1; elseif (c <= -8.8e-75) tmp = 2.0 * ((z * t) - (i * (a * c))); elseif (c <= 4.6e+41) tmp = t_1; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision]}, Block[{t$95$2 = N[(c * N[(b * N[(N[(c * i), $MachinePrecision] * -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[c, -3.25e+122], t$95$2, If[LessEqual[c, -92000000000.0], t$95$1, If[LessEqual[c, -8.8e-75], N[(2.0 * N[(N[(z * t), $MachinePrecision] - N[(i * N[(a * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[c, 4.6e+41], t$95$1, t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(x \cdot y + z \cdot t\right) \cdot 2\\
t_2 := c \cdot \left(b \cdot \left(\left(c \cdot i\right) \cdot -2\right)\right)\\
\mathbf{if}\;c \leq -3.25 \cdot 10^{+122}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;c \leq -92000000000:\\
\;\;\;\;t_1\\
\mathbf{elif}\;c \leq -8.8 \cdot 10^{-75}:\\
\;\;\;\;2 \cdot \left(z \cdot t - i \cdot \left(a \cdot c\right)\right)\\
\mathbf{elif}\;c \leq 4.6 \cdot 10^{+41}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if c < -3.24999999999999982e122 or 4.5999999999999997e41 < c Initial program 76.8%
associate-*l*85.1%
fma-def87.1%
Simplified87.1%
fma-def85.1%
+-commutative85.1%
Applied egg-rr85.1%
Taylor expanded in b around inf 67.4%
mul-1-neg67.4%
*-commutative67.4%
distribute-rgt-neg-in67.4%
unpow267.4%
distribute-rgt-neg-in67.4%
Simplified67.4%
Taylor expanded in i around 0 67.4%
*-commutative67.4%
unpow267.4%
associate-*r*68.8%
associate-*l*72.4%
associate-*r*72.4%
*-commutative72.4%
associate-*l*72.4%
*-commutative72.4%
*-commutative72.4%
associate-*r*71.5%
Simplified71.5%
Taylor expanded in c around 0 67.4%
*-commutative67.4%
unpow267.4%
associate-*l*70.4%
associate-*r*72.4%
*-commutative72.4%
associate-*r*71.5%
associate-*r*71.5%
*-commutative71.5%
associate-*r*72.4%
*-commutative72.4%
associate-*r*72.4%
Simplified72.4%
if -3.24999999999999982e122 < c < -9.2e10 or -8.80000000000000022e-75 < c < 4.5999999999999997e41Initial program 99.2%
Taylor expanded in c around 0 75.4%
if -9.2e10 < c < -8.80000000000000022e-75Initial program 95.0%
Taylor expanded in a around inf 81.1%
Taylor expanded in x around 0 72.2%
associate-*r*68.1%
*-commutative68.1%
*-commutative68.1%
*-commutative68.1%
Simplified68.1%
Final simplification73.6%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= c -2.7e+123) (not (<= c 9.2e+43))) (* c (* b (* (* c i) -2.0))) (* (+ (* 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 <= -2.7e+123) || !(c <= 9.2e+43)) {
tmp = c * (b * ((c * i) * -2.0));
} 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 <= (-2.7d+123)) .or. (.not. (c <= 9.2d+43))) then
tmp = c * (b * ((c * i) * (-2.0d0)))
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 <= -2.7e+123) || !(c <= 9.2e+43)) {
tmp = c * (b * ((c * i) * -2.0));
} else {
tmp = ((x * y) + (z * t)) * 2.0;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if (c <= -2.7e+123) or not (c <= 9.2e+43): tmp = c * (b * ((c * i) * -2.0)) 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 <= -2.7e+123) || !(c <= 9.2e+43)) tmp = Float64(c * Float64(b * Float64(Float64(c * i) * -2.0))); 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 <= -2.7e+123) || ~((c <= 9.2e+43))) tmp = c * (b * ((c * i) * -2.0)); 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, -2.7e+123], N[Not[LessEqual[c, 9.2e+43]], $MachinePrecision]], N[(c * N[(b * N[(N[(c * i), $MachinePrecision] * -2.0), $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 -2.7 \cdot 10^{+123} \lor \neg \left(c \leq 9.2 \cdot 10^{+43}\right):\\
\;\;\;\;c \cdot \left(b \cdot \left(\left(c \cdot i\right) \cdot -2\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(x \cdot y + z \cdot t\right) \cdot 2\\
\end{array}
\end{array}
if c < -2.70000000000000013e123 or 9.200000000000001e43 < c Initial program 76.8%
associate-*l*85.1%
fma-def87.1%
Simplified87.1%
fma-def85.1%
+-commutative85.1%
Applied egg-rr85.1%
Taylor expanded in b around inf 67.4%
mul-1-neg67.4%
*-commutative67.4%
distribute-rgt-neg-in67.4%
unpow267.4%
distribute-rgt-neg-in67.4%
Simplified67.4%
Taylor expanded in i around 0 67.4%
*-commutative67.4%
unpow267.4%
associate-*r*68.8%
associate-*l*72.4%
associate-*r*72.4%
*-commutative72.4%
associate-*l*72.4%
*-commutative72.4%
*-commutative72.4%
associate-*r*71.5%
Simplified71.5%
Taylor expanded in c around 0 67.4%
*-commutative67.4%
unpow267.4%
associate-*l*70.4%
associate-*r*72.4%
*-commutative72.4%
associate-*r*71.5%
associate-*r*71.5%
*-commutative71.5%
associate-*r*72.4%
*-commutative72.4%
associate-*r*72.4%
Simplified72.4%
if -2.70000000000000013e123 < c < 9.200000000000001e43Initial program 98.6%
Taylor expanded in c around 0 71.7%
Final simplification72.0%
(FPCore (x y z t a b c i) :precision binary64 (if (<= c -4.8e+125) (* (* i (* a c)) (- 2.0)) (if (<= c 1.08e+142) (* (+ (* x y) (* z t)) 2.0) (* a (* (* c i) -2.0)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (c <= -4.8e+125) {
tmp = (i * (a * c)) * -2.0;
} else if (c <= 1.08e+142) {
tmp = ((x * y) + (z * t)) * 2.0;
} else {
tmp = a * ((c * i) * -2.0);
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: tmp
if (c <= (-4.8d+125)) then
tmp = (i * (a * c)) * -2.0d0
else if (c <= 1.08d+142) then
tmp = ((x * y) + (z * t)) * 2.0d0
else
tmp = a * ((c * i) * (-2.0d0))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (c <= -4.8e+125) {
tmp = (i * (a * c)) * -2.0;
} else if (c <= 1.08e+142) {
tmp = ((x * y) + (z * t)) * 2.0;
} else {
tmp = a * ((c * i) * -2.0);
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if c <= -4.8e+125: tmp = (i * (a * c)) * -2.0 elif c <= 1.08e+142: tmp = ((x * y) + (z * t)) * 2.0 else: tmp = a * ((c * i) * -2.0) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (c <= -4.8e+125) tmp = Float64(Float64(i * Float64(a * c)) * Float64(-2.0)); elseif (c <= 1.08e+142) tmp = Float64(Float64(Float64(x * y) + Float64(z * t)) * 2.0); else tmp = Float64(a * Float64(Float64(c * i) * -2.0)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if (c <= -4.8e+125) tmp = (i * (a * c)) * -2.0; elseif (c <= 1.08e+142) tmp = ((x * y) + (z * t)) * 2.0; else tmp = a * ((c * i) * -2.0); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[c, -4.8e+125], N[(N[(i * N[(a * c), $MachinePrecision]), $MachinePrecision] * (-2.0)), $MachinePrecision], If[LessEqual[c, 1.08e+142], N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision], N[(a * N[(N[(c * i), $MachinePrecision] * -2.0), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;c \leq -4.8 \cdot 10^{+125}:\\
\;\;\;\;\left(i \cdot \left(a \cdot c\right)\right) \cdot \left(-2\right)\\
\mathbf{elif}\;c \leq 1.08 \cdot 10^{+142}:\\
\;\;\;\;\left(x \cdot y + z \cdot t\right) \cdot 2\\
\mathbf{else}:\\
\;\;\;\;a \cdot \left(\left(c \cdot i\right) \cdot -2\right)\\
\end{array}
\end{array}
if c < -4.7999999999999999e125Initial program 74.2%
associate-*l*84.0%
fma-def89.3%
Simplified89.3%
fma-def84.0%
+-commutative84.0%
Applied egg-rr84.0%
Taylor expanded in a around inf 38.1%
mul-1-neg38.1%
*-commutative38.1%
associate-*r*38.3%
*-commutative38.3%
distribute-lft-neg-out38.3%
*-commutative38.3%
distribute-rgt-neg-in38.3%
Simplified38.3%
if -4.7999999999999999e125 < c < 1.08e142Initial program 96.2%
Taylor expanded in c around 0 66.4%
if 1.08e142 < c Initial program 77.3%
Taylor expanded in a around inf 35.4%
Taylor expanded in z around 0 36.1%
associate-*r*31.2%
*-commutative31.2%
*-commutative31.2%
*-commutative31.2%
Simplified31.2%
Taylor expanded in y around 0 25.7%
mul-1-neg25.7%
associate-*r*32.9%
distribute-rgt-neg-in32.9%
*-commutative32.9%
associate-*r*23.3%
Simplified23.3%
Taylor expanded in i around 0 25.7%
*-commutative25.7%
associate-*r*23.3%
*-commutative23.3%
associate-*r*32.9%
associate-*l*32.9%
Simplified32.9%
Final simplification57.1%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* 2.0 (* x y))))
(if (<= y -1.75e-136)
t_1
(if (<= y 7.5e-143)
(* a (* (* c i) -2.0))
(if (<= y 1.75e+78) (* 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 = 2.0 * (x * y);
double tmp;
if (y <= -1.75e-136) {
tmp = t_1;
} else if (y <= 7.5e-143) {
tmp = a * ((c * i) * -2.0);
} else if (y <= 1.75e+78) {
tmp = 2.0 * (z * t);
} 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 * (x * y)
if (y <= (-1.75d-136)) then
tmp = t_1
else if (y <= 7.5d-143) then
tmp = a * ((c * i) * (-2.0d0))
else if (y <= 1.75d+78) then
tmp = 2.0d0 * (z * t)
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 * (x * y);
double tmp;
if (y <= -1.75e-136) {
tmp = t_1;
} else if (y <= 7.5e-143) {
tmp = a * ((c * i) * -2.0);
} else if (y <= 1.75e+78) {
tmp = 2.0 * (z * t);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = 2.0 * (x * y) tmp = 0 if y <= -1.75e-136: tmp = t_1 elif y <= 7.5e-143: tmp = a * ((c * i) * -2.0) elif y <= 1.75e+78: tmp = 2.0 * (z * t) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(2.0 * Float64(x * y)) tmp = 0.0 if (y <= -1.75e-136) tmp = t_1; elseif (y <= 7.5e-143) tmp = Float64(a * Float64(Float64(c * i) * -2.0)); elseif (y <= 1.75e+78) tmp = Float64(2.0 * Float64(z * t)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = 2.0 * (x * y); tmp = 0.0; if (y <= -1.75e-136) tmp = t_1; elseif (y <= 7.5e-143) tmp = a * ((c * i) * -2.0); elseif (y <= 1.75e+78) tmp = 2.0 * (z * t); 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[(x * y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -1.75e-136], t$95$1, If[LessEqual[y, 7.5e-143], N[(a * N[(N[(c * i), $MachinePrecision] * -2.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.75e+78], N[(2.0 * N[(z * t), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := 2 \cdot \left(x \cdot y\right)\\
\mathbf{if}\;y \leq -1.75 \cdot 10^{-136}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq 7.5 \cdot 10^{-143}:\\
\;\;\;\;a \cdot \left(\left(c \cdot i\right) \cdot -2\right)\\
\mathbf{elif}\;y \leq 1.75 \cdot 10^{+78}:\\
\;\;\;\;2 \cdot \left(z \cdot t\right)\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if y < -1.75000000000000015e-136 or 1.7500000000000001e78 < y Initial program 87.1%
Taylor expanded in x around inf 45.9%
if -1.75000000000000015e-136 < y < 7.5000000000000003e-143Initial program 94.4%
Taylor expanded in a around inf 64.6%
Taylor expanded in z around 0 37.4%
associate-*r*41.5%
*-commutative41.5%
*-commutative41.5%
*-commutative41.5%
Simplified41.5%
Taylor expanded in y around 0 30.5%
mul-1-neg30.5%
associate-*r*40.0%
distribute-rgt-neg-in40.0%
*-commutative40.0%
associate-*r*34.5%
Simplified34.5%
Taylor expanded in i around 0 30.5%
*-commutative30.5%
associate-*r*34.5%
*-commutative34.5%
associate-*r*40.0%
associate-*l*40.0%
Simplified40.0%
if 7.5000000000000003e-143 < y < 1.7500000000000001e78Initial program 92.2%
Taylor expanded in z around inf 30.4%
Final simplification41.4%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= y -4.3e-136) (not (<= y 2e+78))) (* 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 ((y <= -4.3e-136) || !(y <= 2e+78)) {
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 ((y <= (-4.3d-136)) .or. (.not. (y <= 2d+78))) 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 ((y <= -4.3e-136) || !(y <= 2e+78)) {
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 (y <= -4.3e-136) or not (y <= 2e+78): 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 ((y <= -4.3e-136) || !(y <= 2e+78)) 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 ((y <= -4.3e-136) || ~((y <= 2e+78))) 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[y, -4.3e-136], N[Not[LessEqual[y, 2e+78]], $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}\;y \leq -4.3 \cdot 10^{-136} \lor \neg \left(y \leq 2 \cdot 10^{+78}\right):\\
\;\;\;\;2 \cdot \left(x \cdot y\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(z \cdot t\right)\\
\end{array}
\end{array}
if y < -4.3e-136 or 2.00000000000000002e78 < y Initial program 87.1%
Taylor expanded in x around inf 45.9%
if -4.3e-136 < y < 2.00000000000000002e78Initial program 93.5%
Taylor expanded in z around inf 29.1%
Final simplification38.3%
(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 90.0%
Taylor expanded in z around inf 24.1%
Final simplification24.1%
(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 2023196
(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))))