
(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 16 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 (if (<= c -9e+23) (* 2.0 (fma z t (fma c (* (fma b c a) (- i)) (* x y)))) (* 2.0 (- (fma x y (* z t)) (* (+ a (* 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 <= -9e+23) {
tmp = 2.0 * fma(z, t, fma(c, (fma(b, c, a) * -i), (x * y)));
} else {
tmp = 2.0 * (fma(x, y, (z * t)) - ((a + (c * b)) * (c * i)));
}
return tmp;
}
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (c <= -9e+23) tmp = Float64(2.0 * fma(z, t, fma(c, Float64(fma(b, c, a) * Float64(-i)), Float64(x * y)))); else tmp = Float64(2.0 * Float64(fma(x, y, Float64(z * t)) - Float64(Float64(a + Float64(c * b)) * Float64(c * i)))); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[c, -9e+23], N[(2.0 * N[(z * t + N[(c * N[(N[(b * c + a), $MachinePrecision] * (-i)), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[(x * y + N[(z * t), $MachinePrecision]), $MachinePrecision] - N[(N[(a + N[(c * b), $MachinePrecision]), $MachinePrecision] * N[(c * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;c \leq -9 \cdot 10^{+23}:\\
\;\;\;\;2 \cdot \mathsf{fma}\left(z, t, \mathsf{fma}\left(c, \mathsf{fma}\left(b, c, a\right) \cdot \left(-i\right), x \cdot y\right)\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(\mathsf{fma}\left(x, y, z \cdot t\right) - \left(a + c \cdot b\right) \cdot \left(c \cdot i\right)\right)\\
\end{array}
\end{array}
if c < -8.99999999999999958e23Initial program 83.0%
associate--l+83.0%
+-commutative83.0%
associate-+l-83.0%
fma-neg86.5%
neg-sub086.5%
associate-+l-86.5%
neg-sub086.5%
distribute-rgt-neg-in86.5%
*-commutative86.5%
associate-*l*99.8%
fma-def99.8%
+-commutative99.8%
fma-def99.8%
Simplified99.8%
if -8.99999999999999958e23 < c Initial program 94.7%
associate-*l*96.0%
fma-def97.0%
Simplified97.0%
Final simplification97.6%
(FPCore (x y z t a b c i) :precision binary64 (* 2.0 (- (fma x y (* z t)) (* (+ a (* c b)) (* c i)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return 2.0 * (fma(x, y, (z * t)) - ((a + (c * b)) * (c * i)));
}
function code(x, y, z, t, a, b, c, i) return Float64(2.0 * Float64(fma(x, y, Float64(z * t)) - Float64(Float64(a + Float64(c * b)) * Float64(c * i)))) end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(2.0 * N[(N[(x * y + N[(z * t), $MachinePrecision]), $MachinePrecision] - N[(N[(a + N[(c * b), $MachinePrecision]), $MachinePrecision] * N[(c * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
2 \cdot \left(\mathsf{fma}\left(x, y, z \cdot t\right) - \left(a + c \cdot b\right) \cdot \left(c \cdot i\right)\right)
\end{array}
Initial program 92.1%
associate-*l*95.0%
fma-def95.8%
Simplified95.8%
Final simplification95.8%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ a (* c b))) (t_2 (+ (* x y) (* z t))))
(if (<= (- t_2 (* i (* c t_1))) INFINITY)
(* 2.0 (- t_2 (* t_1 (* c i))))
(* 2.0 (- (* x y) (* 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 = a + (c * b);
double t_2 = (x * y) + (z * t);
double tmp;
if ((t_2 - (i * (c * t_1))) <= ((double) INFINITY)) {
tmp = 2.0 * (t_2 - (t_1 * (c * i)));
} else {
tmp = 2.0 * ((x * y) - (c * (i * t_1)));
}
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 + (c * b);
double t_2 = (x * y) + (z * t);
double tmp;
if ((t_2 - (i * (c * t_1))) <= Double.POSITIVE_INFINITY) {
tmp = 2.0 * (t_2 - (t_1 * (c * i)));
} else {
tmp = 2.0 * ((x * y) - (c * (i * t_1)));
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = a + (c * b) t_2 = (x * y) + (z * t) tmp = 0 if (t_2 - (i * (c * t_1))) <= math.inf: tmp = 2.0 * (t_2 - (t_1 * (c * i))) else: tmp = 2.0 * ((x * y) - (c * (i * t_1))) return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(a + Float64(c * b)) t_2 = Float64(Float64(x * y) + Float64(z * t)) tmp = 0.0 if (Float64(t_2 - Float64(i * Float64(c * t_1))) <= Inf) tmp = Float64(2.0 * Float64(t_2 - Float64(t_1 * Float64(c * i)))); else tmp = Float64(2.0 * Float64(Float64(x * y) - Float64(c * Float64(i * t_1)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = a + (c * b); t_2 = (x * y) + (z * t); tmp = 0.0; if ((t_2 - (i * (c * t_1))) <= Inf) tmp = 2.0 * (t_2 - (t_1 * (c * i))); else tmp = 2.0 * ((x * y) - (c * (i * t_1))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(a + N[(c * b), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(t$95$2 - N[(i * N[(c * t$95$1), $MachinePrecision]), $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[(N[(x * y), $MachinePrecision] - N[(c * N[(i * t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a + c \cdot b\\
t_2 := x \cdot y + z \cdot t\\
\mathbf{if}\;t_2 - i \cdot \left(c \cdot t_1\right) \leq \infty:\\
\;\;\;\;2 \cdot \left(t_2 - t_1 \cdot \left(c \cdot i\right)\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(x \cdot y - c \cdot \left(i \cdot t_1\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 96.2%
associate-*l*98.0%
fma-def98.0%
Simplified98.0%
fma-def98.0%
+-commutative98.0%
Applied egg-rr98.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%
Taylor expanded in z around 0 63.7%
Final simplification96.6%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ a (* c b))) (t_2 (* c t_1)))
(if (or (<= t_2 -4e+169) (not (<= t_2 1e+275)))
(* 2.0 (- (* x y) (* c (* i t_1))))
(* 2.0 (- (+ (* x y) (* z t)) (* i t_2))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = a + (c * b);
double t_2 = c * t_1;
double tmp;
if ((t_2 <= -4e+169) || !(t_2 <= 1e+275)) {
tmp = 2.0 * ((x * y) - (c * (i * t_1)));
} else {
tmp = 2.0 * (((x * y) + (z * t)) - (i * 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 = a + (c * b)
t_2 = c * t_1
if ((t_2 <= (-4d+169)) .or. (.not. (t_2 <= 1d+275))) then
tmp = 2.0d0 * ((x * y) - (c * (i * t_1)))
else
tmp = 2.0d0 * (((x * y) + (z * t)) - (i * 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 = a + (c * b);
double t_2 = c * t_1;
double tmp;
if ((t_2 <= -4e+169) || !(t_2 <= 1e+275)) {
tmp = 2.0 * ((x * y) - (c * (i * t_1)));
} else {
tmp = 2.0 * (((x * y) + (z * t)) - (i * t_2));
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = a + (c * b) t_2 = c * t_1 tmp = 0 if (t_2 <= -4e+169) or not (t_2 <= 1e+275): tmp = 2.0 * ((x * y) - (c * (i * t_1))) else: tmp = 2.0 * (((x * y) + (z * t)) - (i * t_2)) return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(a + Float64(c * b)) t_2 = Float64(c * t_1) tmp = 0.0 if ((t_2 <= -4e+169) || !(t_2 <= 1e+275)) tmp = Float64(2.0 * Float64(Float64(x * y) - Float64(c * Float64(i * t_1)))); else tmp = Float64(2.0 * Float64(Float64(Float64(x * y) + Float64(z * t)) - Float64(i * t_2))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = a + (c * b); t_2 = c * t_1; tmp = 0.0; if ((t_2 <= -4e+169) || ~((t_2 <= 1e+275))) tmp = 2.0 * ((x * y) - (c * (i * t_1))); else tmp = 2.0 * (((x * y) + (z * t)) - (i * t_2)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(a + N[(c * b), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(c * t$95$1), $MachinePrecision]}, If[Or[LessEqual[t$95$2, -4e+169], N[Not[LessEqual[t$95$2, 1e+275]], $MachinePrecision]], N[(2.0 * N[(N[(x * y), $MachinePrecision] - N[(c * N[(i * t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] - N[(i * t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a + c \cdot b\\
t_2 := c \cdot t_1\\
\mathbf{if}\;t_2 \leq -4 \cdot 10^{+169} \lor \neg \left(t_2 \leq 10^{+275}\right):\\
\;\;\;\;2 \cdot \left(x \cdot y - c \cdot \left(i \cdot t_1\right)\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(\left(x \cdot y + z \cdot t\right) - i \cdot t_2\right)\\
\end{array}
\end{array}
if (*.f64 (+.f64 a (*.f64 b c)) c) < -3.99999999999999974e169 or 9.9999999999999996e274 < (*.f64 (+.f64 a (*.f64 b c)) c) Initial program 80.3%
Taylor expanded in z around 0 96.4%
if -3.99999999999999974e169 < (*.f64 (+.f64 a (*.f64 b c)) c) < 9.9999999999999996e274Initial program 97.9%
Final simplification97.4%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= c -2.25e+23) (not (<= c 7200000.0))) (* 2.0 (- (* x y) (* c (* i (+ a (* c b)))))) (* 2.0 (+ (* x y) (* z t)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((c <= -2.25e+23) || !(c <= 7200000.0)) {
tmp = 2.0 * ((x * y) - (c * (i * (a + (c * b)))));
} else {
tmp = 2.0 * ((x * y) + (z * t));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: tmp
if ((c <= (-2.25d+23)) .or. (.not. (c <= 7200000.0d0))) then
tmp = 2.0d0 * ((x * y) - (c * (i * (a + (c * b)))))
else
tmp = 2.0d0 * ((x * y) + (z * t))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((c <= -2.25e+23) || !(c <= 7200000.0)) {
tmp = 2.0 * ((x * y) - (c * (i * (a + (c * b)))));
} else {
tmp = 2.0 * ((x * y) + (z * t));
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if (c <= -2.25e+23) or not (c <= 7200000.0): tmp = 2.0 * ((x * y) - (c * (i * (a + (c * b))))) else: tmp = 2.0 * ((x * y) + (z * t)) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if ((c <= -2.25e+23) || !(c <= 7200000.0)) tmp = Float64(2.0 * Float64(Float64(x * y) - Float64(c * Float64(i * Float64(a + Float64(c * b)))))); else tmp = Float64(2.0 * Float64(Float64(x * y) + Float64(z * t))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if ((c <= -2.25e+23) || ~((c <= 7200000.0))) tmp = 2.0 * ((x * y) - (c * (i * (a + (c * b))))); else tmp = 2.0 * ((x * y) + (z * t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[c, -2.25e+23], N[Not[LessEqual[c, 7200000.0]], $MachinePrecision]], N[(2.0 * N[(N[(x * y), $MachinePrecision] - N[(c * N[(i * N[(a + N[(c * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;c \leq -2.25 \cdot 10^{+23} \lor \neg \left(c \leq 7200000\right):\\
\;\;\;\;2 \cdot \left(x \cdot y - c \cdot \left(i \cdot \left(a + c \cdot b\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(x \cdot y + z \cdot t\right)\\
\end{array}
\end{array}
if c < -2.2499999999999999e23 or 7.2e6 < c Initial program 85.6%
Taylor expanded in z around 0 90.6%
if -2.2499999999999999e23 < c < 7.2e6Initial program 97.5%
Taylor expanded in c around 0 79.5%
Final simplification84.5%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= c -9.2e+65) (not (<= c 1.5e+22))) (* 2.0 (- (* x y) (* c (* i (+ a (* c b)))))) (* 2.0 (- (+ (* x y) (* z t)) (* i (* c a))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((c <= -9.2e+65) || !(c <= 1.5e+22)) {
tmp = 2.0 * ((x * y) - (c * (i * (a + (c * b)))));
} else {
tmp = 2.0 * (((x * y) + (z * t)) - (i * (c * a)));
}
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 <= (-9.2d+65)) .or. (.not. (c <= 1.5d+22))) then
tmp = 2.0d0 * ((x * y) - (c * (i * (a + (c * b)))))
else
tmp = 2.0d0 * (((x * y) + (z * t)) - (i * (c * a)))
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 <= -9.2e+65) || !(c <= 1.5e+22)) {
tmp = 2.0 * ((x * y) - (c * (i * (a + (c * b)))));
} else {
tmp = 2.0 * (((x * y) + (z * t)) - (i * (c * a)));
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if (c <= -9.2e+65) or not (c <= 1.5e+22): tmp = 2.0 * ((x * y) - (c * (i * (a + (c * b))))) else: tmp = 2.0 * (((x * y) + (z * t)) - (i * (c * a))) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if ((c <= -9.2e+65) || !(c <= 1.5e+22)) tmp = Float64(2.0 * Float64(Float64(x * y) - Float64(c * Float64(i * Float64(a + Float64(c * b)))))); else tmp = Float64(2.0 * Float64(Float64(Float64(x * y) + Float64(z * t)) - Float64(i * Float64(c * a)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if ((c <= -9.2e+65) || ~((c <= 1.5e+22))) tmp = 2.0 * ((x * y) - (c * (i * (a + (c * b))))); else tmp = 2.0 * (((x * y) + (z * t)) - (i * (c * a))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[c, -9.2e+65], N[Not[LessEqual[c, 1.5e+22]], $MachinePrecision]], N[(2.0 * N[(N[(x * y), $MachinePrecision] - N[(c * N[(i * N[(a + N[(c * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] - N[(i * N[(c * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;c \leq -9.2 \cdot 10^{+65} \lor \neg \left(c \leq 1.5 \cdot 10^{+22}\right):\\
\;\;\;\;2 \cdot \left(x \cdot y - c \cdot \left(i \cdot \left(a + c \cdot b\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(\left(x \cdot y + z \cdot t\right) - i \cdot \left(c \cdot a\right)\right)\\
\end{array}
\end{array}
if c < -9.2e65 or 1.5e22 < c Initial program 84.4%
Taylor expanded in z around 0 93.1%
if -9.2e65 < c < 1.5e22Initial program 97.1%
Taylor expanded in a around inf 89.9%
Final simplification91.2%
(FPCore (x y z t a b c i)
:precision binary64
(if (<= x -1.15e+138)
(* 2.0 (+ (* x y) (* z t)))
(if (<= x 1.45e-145)
(* 2.0 (- (* z t) (* c (* i (+ a (* c b))))))
(* 2.0 (- (* x y) (* i (* c a)))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (x <= -1.15e+138) {
tmp = 2.0 * ((x * y) + (z * t));
} else if (x <= 1.45e-145) {
tmp = 2.0 * ((z * t) - (c * (i * (a + (c * b)))));
} else {
tmp = 2.0 * ((x * y) - (i * (c * a)));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: tmp
if (x <= (-1.15d+138)) then
tmp = 2.0d0 * ((x * y) + (z * t))
else if (x <= 1.45d-145) then
tmp = 2.0d0 * ((z * t) - (c * (i * (a + (c * b)))))
else
tmp = 2.0d0 * ((x * y) - (i * (c * a)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (x <= -1.15e+138) {
tmp = 2.0 * ((x * y) + (z * t));
} else if (x <= 1.45e-145) {
tmp = 2.0 * ((z * t) - (c * (i * (a + (c * b)))));
} else {
tmp = 2.0 * ((x * y) - (i * (c * a)));
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if x <= -1.15e+138: tmp = 2.0 * ((x * y) + (z * t)) elif x <= 1.45e-145: tmp = 2.0 * ((z * t) - (c * (i * (a + (c * b))))) else: tmp = 2.0 * ((x * y) - (i * (c * a))) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (x <= -1.15e+138) tmp = Float64(2.0 * Float64(Float64(x * y) + Float64(z * t))); elseif (x <= 1.45e-145) tmp = Float64(2.0 * Float64(Float64(z * t) - Float64(c * Float64(i * Float64(a + Float64(c * b)))))); else tmp = Float64(2.0 * Float64(Float64(x * y) - Float64(i * Float64(c * a)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if (x <= -1.15e+138) tmp = 2.0 * ((x * y) + (z * t)); elseif (x <= 1.45e-145) tmp = 2.0 * ((z * t) - (c * (i * (a + (c * b))))); else tmp = 2.0 * ((x * y) - (i * (c * a))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[x, -1.15e+138], N[(2.0 * N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 1.45e-145], N[(2.0 * N[(N[(z * t), $MachinePrecision] - N[(c * N[(i * N[(a + N[(c * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[(x * y), $MachinePrecision] - N[(i * N[(c * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.15 \cdot 10^{+138}:\\
\;\;\;\;2 \cdot \left(x \cdot y + z \cdot t\right)\\
\mathbf{elif}\;x \leq 1.45 \cdot 10^{-145}:\\
\;\;\;\;2 \cdot \left(z \cdot t - c \cdot \left(i \cdot \left(a + c \cdot b\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(x \cdot y - i \cdot \left(c \cdot a\right)\right)\\
\end{array}
\end{array}
if x < -1.15000000000000004e138Initial program 90.3%
Taylor expanded in c around 0 68.2%
if -1.15000000000000004e138 < x < 1.44999999999999992e-145Initial program 94.2%
Taylor expanded in x around 0 79.4%
if 1.44999999999999992e-145 < x Initial program 90.3%
Taylor expanded in a around inf 75.5%
Taylor expanded in z around 0 58.3%
associate-*r*60.4%
*-commutative60.4%
Simplified60.4%
Final simplification70.5%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= c -3.4e+64) (not (<= c 112000000.0))) (* (* c (* i (+ a (* c b)))) -2.0) (* 2.0 (+ (* x y) (* z t)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((c <= -3.4e+64) || !(c <= 112000000.0)) {
tmp = (c * (i * (a + (c * b)))) * -2.0;
} else {
tmp = 2.0 * ((x * y) + (z * t));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: tmp
if ((c <= (-3.4d+64)) .or. (.not. (c <= 112000000.0d0))) then
tmp = (c * (i * (a + (c * b)))) * (-2.0d0)
else
tmp = 2.0d0 * ((x * y) + (z * t))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((c <= -3.4e+64) || !(c <= 112000000.0)) {
tmp = (c * (i * (a + (c * b)))) * -2.0;
} else {
tmp = 2.0 * ((x * y) + (z * t));
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if (c <= -3.4e+64) or not (c <= 112000000.0): tmp = (c * (i * (a + (c * b)))) * -2.0 else: tmp = 2.0 * ((x * y) + (z * t)) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if ((c <= -3.4e+64) || !(c <= 112000000.0)) tmp = Float64(Float64(c * Float64(i * Float64(a + Float64(c * b)))) * -2.0); else tmp = Float64(2.0 * Float64(Float64(x * y) + Float64(z * t))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if ((c <= -3.4e+64) || ~((c <= 112000000.0))) tmp = (c * (i * (a + (c * b)))) * -2.0; else tmp = 2.0 * ((x * y) + (z * t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[c, -3.4e+64], N[Not[LessEqual[c, 112000000.0]], $MachinePrecision]], N[(N[(c * N[(i * N[(a + N[(c * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * -2.0), $MachinePrecision], N[(2.0 * N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;c \leq -3.4 \cdot 10^{+64} \lor \neg \left(c \leq 112000000\right):\\
\;\;\;\;\left(c \cdot \left(i \cdot \left(a + c \cdot b\right)\right)\right) \cdot -2\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(x \cdot y + z \cdot t\right)\\
\end{array}
\end{array}
if c < -3.4000000000000002e64 or 1.12e8 < c Initial program 85.7%
Taylor expanded in i around inf 78.3%
Taylor expanded in i around 0 78.3%
if -3.4000000000000002e64 < c < 1.12e8Initial program 96.9%
Taylor expanded in c around 0 78.3%
Final simplification78.3%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* 2.0 (* x y))))
(if (<= y -9e-127)
t_1
(if (<= y 9.6e-14)
(* 2.0 (* z t))
(if (<= y 1.38e+164) (* (* a (* c i)) (- 2.0)) t_1)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = 2.0 * (x * y);
double tmp;
if (y <= -9e-127) {
tmp = t_1;
} else if (y <= 9.6e-14) {
tmp = 2.0 * (z * t);
} else if (y <= 1.38e+164) {
tmp = (a * (c * i)) * -2.0;
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: t_1
real(8) :: tmp
t_1 = 2.0d0 * (x * y)
if (y <= (-9d-127)) then
tmp = t_1
else if (y <= 9.6d-14) then
tmp = 2.0d0 * (z * t)
else if (y <= 1.38d+164) then
tmp = (a * (c * i)) * -2.0d0
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = 2.0 * (x * y);
double tmp;
if (y <= -9e-127) {
tmp = t_1;
} else if (y <= 9.6e-14) {
tmp = 2.0 * (z * t);
} else if (y <= 1.38e+164) {
tmp = (a * (c * i)) * -2.0;
} 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 <= -9e-127: tmp = t_1 elif y <= 9.6e-14: tmp = 2.0 * (z * t) elif y <= 1.38e+164: tmp = (a * (c * i)) * -2.0 else: tmp = t_1 return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(2.0 * Float64(x * y)) tmp = 0.0 if (y <= -9e-127) tmp = t_1; elseif (y <= 9.6e-14) tmp = Float64(2.0 * Float64(z * t)); elseif (y <= 1.38e+164) tmp = Float64(Float64(a * Float64(c * i)) * Float64(-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 * (x * y); tmp = 0.0; if (y <= -9e-127) tmp = t_1; elseif (y <= 9.6e-14) tmp = 2.0 * (z * t); elseif (y <= 1.38e+164) tmp = (a * (c * i)) * -2.0; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(2.0 * N[(x * y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -9e-127], t$95$1, If[LessEqual[y, 9.6e-14], N[(2.0 * N[(z * t), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.38e+164], N[(N[(a * N[(c * i), $MachinePrecision]), $MachinePrecision] * (-2.0)), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := 2 \cdot \left(x \cdot y\right)\\
\mathbf{if}\;y \leq -9 \cdot 10^{-127}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq 9.6 \cdot 10^{-14}:\\
\;\;\;\;2 \cdot \left(z \cdot t\right)\\
\mathbf{elif}\;y \leq 1.38 \cdot 10^{+164}:\\
\;\;\;\;\left(a \cdot \left(c \cdot i\right)\right) \cdot \left(-2\right)\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if y < -8.9999999999999998e-127 or 1.3800000000000001e164 < y Initial program 90.6%
Taylor expanded in x around inf 48.1%
if -8.9999999999999998e-127 < y < 9.599999999999999e-14Initial program 92.0%
Taylor expanded in z around inf 34.3%
if 9.599999999999999e-14 < y < 1.3800000000000001e164Initial program 97.0%
associate-*l*94.6%
fma-def94.6%
Simplified94.6%
add-cube-cbrt94.3%
pow394.3%
+-commutative94.3%
fma-udef94.3%
Applied egg-rr94.3%
Taylor expanded in a around inf 36.8%
mul-1-neg36.8%
*-commutative36.8%
*-commutative36.8%
associate-*l*39.4%
*-commutative39.4%
distribute-rgt-neg-in39.4%
distribute-rgt-neg-in39.4%
Simplified39.4%
Final simplification41.2%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* 2.0 (* x y))) (t_2 (* 2.0 (* z t))))
(if (<= t -1.6e-114)
t_2
(if (<= t 3.1e-261)
t_1
(if (<= t 2.55e-242)
(* (* c -2.0) (* a i))
(if (<= t 1.2e+177) t_1 t_2))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = 2.0 * (x * y);
double t_2 = 2.0 * (z * t);
double tmp;
if (t <= -1.6e-114) {
tmp = t_2;
} else if (t <= 3.1e-261) {
tmp = t_1;
} else if (t <= 2.55e-242) {
tmp = (c * -2.0) * (a * i);
} else if (t <= 1.2e+177) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = 2.0d0 * (x * y)
t_2 = 2.0d0 * (z * t)
if (t <= (-1.6d-114)) then
tmp = t_2
else if (t <= 3.1d-261) then
tmp = t_1
else if (t <= 2.55d-242) then
tmp = (c * (-2.0d0)) * (a * i)
else if (t <= 1.2d+177) then
tmp = t_1
else
tmp = t_2
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = 2.0 * (x * y);
double t_2 = 2.0 * (z * t);
double tmp;
if (t <= -1.6e-114) {
tmp = t_2;
} else if (t <= 3.1e-261) {
tmp = t_1;
} else if (t <= 2.55e-242) {
tmp = (c * -2.0) * (a * i);
} else if (t <= 1.2e+177) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = 2.0 * (x * y) t_2 = 2.0 * (z * t) tmp = 0 if t <= -1.6e-114: tmp = t_2 elif t <= 3.1e-261: tmp = t_1 elif t <= 2.55e-242: tmp = (c * -2.0) * (a * i) elif t <= 1.2e+177: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(2.0 * Float64(x * y)) t_2 = Float64(2.0 * Float64(z * t)) tmp = 0.0 if (t <= -1.6e-114) tmp = t_2; elseif (t <= 3.1e-261) tmp = t_1; elseif (t <= 2.55e-242) tmp = Float64(Float64(c * -2.0) * Float64(a * i)); elseif (t <= 1.2e+177) tmp = t_1; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = 2.0 * (x * y); t_2 = 2.0 * (z * t); tmp = 0.0; if (t <= -1.6e-114) tmp = t_2; elseif (t <= 3.1e-261) tmp = t_1; elseif (t <= 2.55e-242) tmp = (c * -2.0) * (a * i); elseif (t <= 1.2e+177) tmp = t_1; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(2.0 * N[(x * y), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(2.0 * N[(z * t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -1.6e-114], t$95$2, If[LessEqual[t, 3.1e-261], t$95$1, If[LessEqual[t, 2.55e-242], N[(N[(c * -2.0), $MachinePrecision] * N[(a * i), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.2e+177], t$95$1, t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := 2 \cdot \left(x \cdot y\right)\\
t_2 := 2 \cdot \left(z \cdot t\right)\\
\mathbf{if}\;t \leq -1.6 \cdot 10^{-114}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;t \leq 3.1 \cdot 10^{-261}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t \leq 2.55 \cdot 10^{-242}:\\
\;\;\;\;\left(c \cdot -2\right) \cdot \left(a \cdot i\right)\\
\mathbf{elif}\;t \leq 1.2 \cdot 10^{+177}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if t < -1.6000000000000001e-114 or 1.2e177 < t Initial program 88.8%
Taylor expanded in z around inf 47.9%
if -1.6000000000000001e-114 < t < 3.0999999999999998e-261 or 2.54999999999999984e-242 < t < 1.2e177Initial program 94.1%
Taylor expanded in x around inf 43.2%
if 3.0999999999999998e-261 < t < 2.54999999999999984e-242Initial program 99.6%
associate-*l*100.0%
fma-def100.0%
Simplified100.0%
add-cube-cbrt98.8%
pow398.8%
+-commutative98.8%
fma-udef98.8%
Applied egg-rr98.8%
Taylor expanded in a around inf 75.5%
mul-1-neg75.5%
*-commutative75.5%
*-commutative75.5%
associate-*l*75.9%
*-commutative75.9%
distribute-rgt-neg-in75.9%
distribute-rgt-neg-in75.9%
Simplified75.9%
Taylor expanded in a around 0 75.5%
associate-*r*75.5%
Simplified75.5%
Final simplification46.2%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= c -2.9e+100) (not (<= c 2.35e+54))) (* -2.0 (* c (* c (* b i)))) (* 2.0 (+ (* x y) (* z t)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((c <= -2.9e+100) || !(c <= 2.35e+54)) {
tmp = -2.0 * (c * (c * (b * i)));
} else {
tmp = 2.0 * ((x * y) + (z * t));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: tmp
if ((c <= (-2.9d+100)) .or. (.not. (c <= 2.35d+54))) then
tmp = (-2.0d0) * (c * (c * (b * i)))
else
tmp = 2.0d0 * ((x * y) + (z * t))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((c <= -2.9e+100) || !(c <= 2.35e+54)) {
tmp = -2.0 * (c * (c * (b * i)));
} else {
tmp = 2.0 * ((x * y) + (z * t));
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if (c <= -2.9e+100) or not (c <= 2.35e+54): tmp = -2.0 * (c * (c * (b * i))) else: tmp = 2.0 * ((x * y) + (z * t)) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if ((c <= -2.9e+100) || !(c <= 2.35e+54)) tmp = Float64(-2.0 * Float64(c * Float64(c * Float64(b * i)))); else tmp = Float64(2.0 * Float64(Float64(x * y) + Float64(z * t))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if ((c <= -2.9e+100) || ~((c <= 2.35e+54))) tmp = -2.0 * (c * (c * (b * i))); else tmp = 2.0 * ((x * y) + (z * t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[c, -2.9e+100], N[Not[LessEqual[c, 2.35e+54]], $MachinePrecision]], N[(-2.0 * N[(c * N[(c * N[(b * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;c \leq -2.9 \cdot 10^{+100} \lor \neg \left(c \leq 2.35 \cdot 10^{+54}\right):\\
\;\;\;\;-2 \cdot \left(c \cdot \left(c \cdot \left(b \cdot i\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(x \cdot y + z \cdot t\right)\\
\end{array}
\end{array}
if c < -2.9e100 or 2.34999999999999996e54 < c Initial program 87.0%
Taylor expanded in b around inf 66.6%
mul-1-neg66.6%
*-commutative66.6%
distribute-rgt-neg-in66.6%
unpow266.6%
distribute-rgt-neg-in66.6%
Simplified66.6%
Taylor expanded in i around 0 66.6%
*-commutative66.6%
unpow266.6%
*-commutative66.6%
Simplified66.6%
Taylor expanded in c around 0 66.6%
unpow266.6%
associate-*r*64.6%
Simplified64.6%
if -2.9e100 < c < 2.34999999999999996e54Initial program 94.9%
Taylor expanded in c around 0 74.3%
Final simplification70.9%
(FPCore (x y z t a b c i) :precision binary64 (if (<= a -3.95e+242) (* (* a (* c i)) (- 2.0)) (if (<= a 8e+171) (* 2.0 (+ (* x y) (* z t))) (* (* c a) (* i -2.0)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (a <= -3.95e+242) {
tmp = (a * (c * i)) * -2.0;
} else if (a <= 8e+171) {
tmp = 2.0 * ((x * y) + (z * t));
} else {
tmp = (c * a) * (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 (a <= (-3.95d+242)) then
tmp = (a * (c * i)) * -2.0d0
else if (a <= 8d+171) then
tmp = 2.0d0 * ((x * y) + (z * t))
else
tmp = (c * a) * (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 (a <= -3.95e+242) {
tmp = (a * (c * i)) * -2.0;
} else if (a <= 8e+171) {
tmp = 2.0 * ((x * y) + (z * t));
} else {
tmp = (c * a) * (i * -2.0);
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if a <= -3.95e+242: tmp = (a * (c * i)) * -2.0 elif a <= 8e+171: tmp = 2.0 * ((x * y) + (z * t)) else: tmp = (c * a) * (i * -2.0) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (a <= -3.95e+242) tmp = Float64(Float64(a * Float64(c * i)) * Float64(-2.0)); elseif (a <= 8e+171) tmp = Float64(2.0 * Float64(Float64(x * y) + Float64(z * t))); else tmp = Float64(Float64(c * a) * Float64(i * -2.0)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if (a <= -3.95e+242) tmp = (a * (c * i)) * -2.0; elseif (a <= 8e+171) tmp = 2.0 * ((x * y) + (z * t)); else tmp = (c * a) * (i * -2.0); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[a, -3.95e+242], N[(N[(a * N[(c * i), $MachinePrecision]), $MachinePrecision] * (-2.0)), $MachinePrecision], If[LessEqual[a, 8e+171], N[(2.0 * N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(c * a), $MachinePrecision] * N[(i * -2.0), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -3.95 \cdot 10^{+242}:\\
\;\;\;\;\left(a \cdot \left(c \cdot i\right)\right) \cdot \left(-2\right)\\
\mathbf{elif}\;a \leq 8 \cdot 10^{+171}:\\
\;\;\;\;2 \cdot \left(x \cdot y + z \cdot t\right)\\
\mathbf{else}:\\
\;\;\;\;\left(c \cdot a\right) \cdot \left(i \cdot -2\right)\\
\end{array}
\end{array}
if a < -3.94999999999999993e242Initial program 85.5%
associate-*l*96.2%
fma-def96.2%
Simplified96.2%
add-cube-cbrt96.0%
pow396.0%
+-commutative96.0%
fma-udef96.0%
Applied egg-rr96.0%
Taylor expanded in a around inf 60.3%
mul-1-neg60.3%
*-commutative60.3%
*-commutative60.3%
associate-*l*67.1%
*-commutative67.1%
distribute-rgt-neg-in67.1%
distribute-rgt-neg-in67.1%
Simplified67.1%
if -3.94999999999999993e242 < a < 7.99999999999999963e171Initial program 93.2%
Taylor expanded in c around 0 60.6%
if 7.99999999999999963e171 < a Initial program 89.5%
associate-*l*89.4%
fma-def94.7%
Simplified94.7%
add-cube-cbrt94.4%
pow394.4%
+-commutative94.4%
fma-udef94.4%
Applied egg-rr94.4%
Taylor expanded in a around inf 54.4%
mul-1-neg54.4%
*-commutative54.4%
*-commutative54.4%
associate-*l*59.4%
*-commutative59.4%
distribute-rgt-neg-in59.4%
distribute-rgt-neg-in59.4%
Simplified59.4%
Taylor expanded in a around 0 54.4%
*-commutative54.4%
*-commutative54.4%
associate-*r*64.4%
associate-*l*64.4%
Simplified64.4%
Final simplification61.6%
(FPCore (x y z t a b c i)
:precision binary64
(if (<= c -2.5e+100)
(* -2.0 (* c (* c (* b i))))
(if (<= c 2.9e+56)
(* 2.0 (+ (* x y) (* z t)))
(* -2.0 (* (* c c) (* b i))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (c <= -2.5e+100) {
tmp = -2.0 * (c * (c * (b * i)));
} else if (c <= 2.9e+56) {
tmp = 2.0 * ((x * y) + (z * t));
} else {
tmp = -2.0 * ((c * c) * (b * i));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: tmp
if (c <= (-2.5d+100)) then
tmp = (-2.0d0) * (c * (c * (b * i)))
else if (c <= 2.9d+56) then
tmp = 2.0d0 * ((x * y) + (z * t))
else
tmp = (-2.0d0) * ((c * c) * (b * i))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (c <= -2.5e+100) {
tmp = -2.0 * (c * (c * (b * i)));
} else if (c <= 2.9e+56) {
tmp = 2.0 * ((x * y) + (z * t));
} else {
tmp = -2.0 * ((c * c) * (b * i));
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if c <= -2.5e+100: tmp = -2.0 * (c * (c * (b * i))) elif c <= 2.9e+56: tmp = 2.0 * ((x * y) + (z * t)) else: tmp = -2.0 * ((c * c) * (b * i)) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (c <= -2.5e+100) tmp = Float64(-2.0 * Float64(c * Float64(c * Float64(b * i)))); elseif (c <= 2.9e+56) tmp = Float64(2.0 * Float64(Float64(x * y) + Float64(z * t))); else tmp = Float64(-2.0 * Float64(Float64(c * c) * Float64(b * i))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if (c <= -2.5e+100) tmp = -2.0 * (c * (c * (b * i))); elseif (c <= 2.9e+56) tmp = 2.0 * ((x * y) + (z * t)); else tmp = -2.0 * ((c * c) * (b * i)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[c, -2.5e+100], N[(-2.0 * N[(c * N[(c * N[(b * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[c, 2.9e+56], N[(2.0 * N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(-2.0 * N[(N[(c * c), $MachinePrecision] * N[(b * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;c \leq -2.5 \cdot 10^{+100}:\\
\;\;\;\;-2 \cdot \left(c \cdot \left(c \cdot \left(b \cdot i\right)\right)\right)\\
\mathbf{elif}\;c \leq 2.9 \cdot 10^{+56}:\\
\;\;\;\;2 \cdot \left(x \cdot y + z \cdot t\right)\\
\mathbf{else}:\\
\;\;\;\;-2 \cdot \left(\left(c \cdot c\right) \cdot \left(b \cdot i\right)\right)\\
\end{array}
\end{array}
if c < -2.4999999999999999e100Initial program 86.4%
Taylor expanded in b around inf 63.5%
mul-1-neg63.5%
*-commutative63.5%
distribute-rgt-neg-in63.5%
unpow263.5%
distribute-rgt-neg-in63.5%
Simplified63.5%
Taylor expanded in i around 0 63.5%
*-commutative63.5%
unpow263.5%
*-commutative63.5%
Simplified63.5%
Taylor expanded in c around 0 63.5%
unpow263.5%
associate-*r*63.6%
Simplified63.6%
if -2.4999999999999999e100 < c < 2.90000000000000007e56Initial program 94.9%
Taylor expanded in c around 0 74.3%
if 2.90000000000000007e56 < c Initial program 87.5%
Taylor expanded in b around inf 69.3%
mul-1-neg69.3%
*-commutative69.3%
distribute-rgt-neg-in69.3%
unpow269.3%
distribute-rgt-neg-in69.3%
Simplified69.3%
Taylor expanded in i around 0 69.3%
*-commutative69.3%
unpow269.3%
*-commutative69.3%
Simplified69.3%
Final simplification71.6%
(FPCore (x y z t a b c i)
:precision binary64
(if (<= c -4.7e+115)
(* -2.0 (* (* c i) (* c b)))
(if (<= c 6.5e+56)
(* 2.0 (+ (* x y) (* z t)))
(* -2.0 (* (* c c) (* b i))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (c <= -4.7e+115) {
tmp = -2.0 * ((c * i) * (c * b));
} else if (c <= 6.5e+56) {
tmp = 2.0 * ((x * y) + (z * t));
} else {
tmp = -2.0 * ((c * c) * (b * i));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: tmp
if (c <= (-4.7d+115)) then
tmp = (-2.0d0) * ((c * i) * (c * b))
else if (c <= 6.5d+56) then
tmp = 2.0d0 * ((x * y) + (z * t))
else
tmp = (-2.0d0) * ((c * c) * (b * i))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (c <= -4.7e+115) {
tmp = -2.0 * ((c * i) * (c * b));
} else if (c <= 6.5e+56) {
tmp = 2.0 * ((x * y) + (z * t));
} else {
tmp = -2.0 * ((c * c) * (b * i));
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if c <= -4.7e+115: tmp = -2.0 * ((c * i) * (c * b)) elif c <= 6.5e+56: tmp = 2.0 * ((x * y) + (z * t)) else: tmp = -2.0 * ((c * c) * (b * i)) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (c <= -4.7e+115) tmp = Float64(-2.0 * Float64(Float64(c * i) * Float64(c * b))); elseif (c <= 6.5e+56) tmp = Float64(2.0 * Float64(Float64(x * y) + Float64(z * t))); else tmp = Float64(-2.0 * Float64(Float64(c * c) * Float64(b * i))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if (c <= -4.7e+115) tmp = -2.0 * ((c * i) * (c * b)); elseif (c <= 6.5e+56) tmp = 2.0 * ((x * y) + (z * t)); else tmp = -2.0 * ((c * c) * (b * i)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[c, -4.7e+115], N[(-2.0 * N[(N[(c * i), $MachinePrecision] * N[(c * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[c, 6.5e+56], N[(2.0 * N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(-2.0 * N[(N[(c * c), $MachinePrecision] * N[(b * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;c \leq -4.7 \cdot 10^{+115}:\\
\;\;\;\;-2 \cdot \left(\left(c \cdot i\right) \cdot \left(c \cdot b\right)\right)\\
\mathbf{elif}\;c \leq 6.5 \cdot 10^{+56}:\\
\;\;\;\;2 \cdot \left(x \cdot y + z \cdot t\right)\\
\mathbf{else}:\\
\;\;\;\;-2 \cdot \left(\left(c \cdot c\right) \cdot \left(b \cdot i\right)\right)\\
\end{array}
\end{array}
if c < -4.6999999999999996e115Initial program 85.1%
Taylor expanded in b around inf 64.9%
mul-1-neg64.9%
*-commutative64.9%
distribute-rgt-neg-in64.9%
unpow264.9%
distribute-rgt-neg-in64.9%
Simplified64.9%
Taylor expanded in i around 0 64.9%
*-commutative64.9%
unpow264.9%
*-commutative64.9%
Simplified64.9%
Taylor expanded in c around 0 64.9%
unpow264.9%
associate-*r*65.0%
*-commutative65.0%
associate-*r*67.6%
associate-*l*67.7%
*-commutative67.7%
Simplified67.7%
if -4.6999999999999996e115 < c < 6.5000000000000001e56Initial program 95.0%
Taylor expanded in c around 0 73.2%
if 6.5000000000000001e56 < c Initial program 87.5%
Taylor expanded in b around inf 69.3%
mul-1-neg69.3%
*-commutative69.3%
distribute-rgt-neg-in69.3%
unpow269.3%
distribute-rgt-neg-in69.3%
Simplified69.3%
Taylor expanded in i around 0 69.3%
*-commutative69.3%
unpow269.3%
*-commutative69.3%
Simplified69.3%
Final simplification71.7%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= t -3.7e-110) (not (<= t 8.8e+176))) (* 2.0 (* z t)) (* 2.0 (* x y))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((t <= -3.7e-110) || !(t <= 8.8e+176)) {
tmp = 2.0 * (z * t);
} else {
tmp = 2.0 * (x * y);
}
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 ((t <= (-3.7d-110)) .or. (.not. (t <= 8.8d+176))) then
tmp = 2.0d0 * (z * t)
else
tmp = 2.0d0 * (x * y)
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 ((t <= -3.7e-110) || !(t <= 8.8e+176)) {
tmp = 2.0 * (z * t);
} else {
tmp = 2.0 * (x * y);
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if (t <= -3.7e-110) or not (t <= 8.8e+176): tmp = 2.0 * (z * t) else: tmp = 2.0 * (x * y) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if ((t <= -3.7e-110) || !(t <= 8.8e+176)) tmp = Float64(2.0 * Float64(z * t)); else tmp = Float64(2.0 * Float64(x * y)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if ((t <= -3.7e-110) || ~((t <= 8.8e+176))) tmp = 2.0 * (z * t); else tmp = 2.0 * (x * y); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[t, -3.7e-110], N[Not[LessEqual[t, 8.8e+176]], $MachinePrecision]], N[(2.0 * N[(z * t), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(x * y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -3.7 \cdot 10^{-110} \lor \neg \left(t \leq 8.8 \cdot 10^{+176}\right):\\
\;\;\;\;2 \cdot \left(z \cdot t\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(x \cdot y\right)\\
\end{array}
\end{array}
if t < -3.70000000000000016e-110 or 8.80000000000000029e176 < t Initial program 88.8%
Taylor expanded in z around inf 47.9%
if -3.70000000000000016e-110 < t < 8.80000000000000029e176Initial program 94.4%
Taylor expanded in x around inf 42.3%
Final simplification44.7%
(FPCore (x y z t a b c i) :precision binary64 (* 2.0 (* z t)))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return 2.0 * (z * t);
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
code = 2.0d0 * (z * t)
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return 2.0 * (z * t);
}
def code(x, y, z, t, a, b, c, i): return 2.0 * (z * t)
function code(x, y, z, t, a, b, c, i) return Float64(2.0 * Float64(z * t)) end
function tmp = code(x, y, z, t, a, b, c, i) tmp = 2.0 * (z * t); end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(2.0 * N[(z * t), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
2 \cdot \left(z \cdot t\right)
\end{array}
Initial program 92.1%
Taylor expanded in z around inf 28.7%
Final simplification28.7%
(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 2023278
(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))))