
(FPCore (x y z t a b c) :precision binary64 (+ (- (+ (* x y) (/ (* z t) 16.0)) (/ (* a b) 4.0)) c))
double code(double x, double y, double z, double t, double a, double b, double c) {
return (((x * y) + ((z * t) / 16.0)) - ((a * b) / 4.0)) + c;
}
real(8) function code(x, y, z, t, a, b, c)
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
code = (((x * y) + ((z * t) / 16.0d0)) - ((a * b) / 4.0d0)) + c
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
return (((x * y) + ((z * t) / 16.0)) - ((a * b) / 4.0)) + c;
}
def code(x, y, z, t, a, b, c): return (((x * y) + ((z * t) / 16.0)) - ((a * b) / 4.0)) + c
function code(x, y, z, t, a, b, c) return Float64(Float64(Float64(Float64(x * y) + Float64(Float64(z * t) / 16.0)) - Float64(Float64(a * b) / 4.0)) + c) end
function tmp = code(x, y, z, t, a, b, c) tmp = (((x * y) + ((z * t) / 16.0)) - ((a * b) / 4.0)) + c; end
code[x_, y_, z_, t_, a_, b_, c_] := N[(N[(N[(N[(x * y), $MachinePrecision] + N[(N[(z * t), $MachinePrecision] / 16.0), $MachinePrecision]), $MachinePrecision] - N[(N[(a * b), $MachinePrecision] / 4.0), $MachinePrecision]), $MachinePrecision] + c), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(x \cdot y + \frac{z \cdot t}{16}\right) - \frac{a \cdot b}{4}\right) + c
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 16 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a b c) :precision binary64 (+ (- (+ (* x y) (/ (* z t) 16.0)) (/ (* a b) 4.0)) c))
double code(double x, double y, double z, double t, double a, double b, double c) {
return (((x * y) + ((z * t) / 16.0)) - ((a * b) / 4.0)) + c;
}
real(8) function code(x, y, z, t, a, b, c)
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
code = (((x * y) + ((z * t) / 16.0d0)) - ((a * b) / 4.0d0)) + c
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
return (((x * y) + ((z * t) / 16.0)) - ((a * b) / 4.0)) + c;
}
def code(x, y, z, t, a, b, c): return (((x * y) + ((z * t) / 16.0)) - ((a * b) / 4.0)) + c
function code(x, y, z, t, a, b, c) return Float64(Float64(Float64(Float64(x * y) + Float64(Float64(z * t) / 16.0)) - Float64(Float64(a * b) / 4.0)) + c) end
function tmp = code(x, y, z, t, a, b, c) tmp = (((x * y) + ((z * t) / 16.0)) - ((a * b) / 4.0)) + c; end
code[x_, y_, z_, t_, a_, b_, c_] := N[(N[(N[(N[(x * y), $MachinePrecision] + N[(N[(z * t), $MachinePrecision] / 16.0), $MachinePrecision]), $MachinePrecision] - N[(N[(a * b), $MachinePrecision] / 4.0), $MachinePrecision]), $MachinePrecision] + c), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(x \cdot y + \frac{z \cdot t}{16}\right) - \frac{a \cdot b}{4}\right) + c
\end{array}
(FPCore (x y z t a b c) :precision binary64 (+ (fma x y (fma z (/ t 16.0) (/ (* a b) -4.0))) c))
double code(double x, double y, double z, double t, double a, double b, double c) {
return fma(x, y, fma(z, (t / 16.0), ((a * b) / -4.0))) + c;
}
function code(x, y, z, t, a, b, c) return Float64(fma(x, y, fma(z, Float64(t / 16.0), Float64(Float64(a * b) / -4.0))) + c) end
code[x_, y_, z_, t_, a_, b_, c_] := N[(N[(x * y + N[(z * N[(t / 16.0), $MachinePrecision] + N[(N[(a * b), $MachinePrecision] / -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + c), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(x, y, \mathsf{fma}\left(z, \frac{t}{16}, \frac{a \cdot b}{-4}\right)\right) + c
\end{array}
Initial program 96.9%
associate--l+96.9%
fma-define98.8%
associate-/l*98.8%
fma-neg98.8%
distribute-neg-frac298.8%
metadata-eval98.8%
Simplified98.8%
(FPCore (x y z t a b c) :precision binary64 (+ c (- (fma x y (* z (/ t 16.0))) (* a (/ b 4.0)))))
double code(double x, double y, double z, double t, double a, double b, double c) {
return c + (fma(x, y, (z * (t / 16.0))) - (a * (b / 4.0)));
}
function code(x, y, z, t, a, b, c) return Float64(c + Float64(fma(x, y, Float64(z * Float64(t / 16.0))) - Float64(a * Float64(b / 4.0)))) end
code[x_, y_, z_, t_, a_, b_, c_] := N[(c + N[(N[(x * y + N[(z * N[(t / 16.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(a * N[(b / 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
c + \left(\mathsf{fma}\left(x, y, z \cdot \frac{t}{16}\right) - a \cdot \frac{b}{4}\right)
\end{array}
Initial program 96.9%
associate-+l-96.9%
*-commutative96.9%
associate-+l-96.9%
fma-define97.6%
*-commutative97.6%
associate-/l*97.6%
associate-/l*97.6%
Simplified97.6%
Final simplification97.6%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (* b (* a -0.25))) (t_2 (* z (* t 0.0625))))
(if (<= (* x y) -3.65e+140)
(* x y)
(if (<= (* x y) -3.9e+39)
t_1
(if (<= (* x y) -860000000.0)
t_2
(if (<= (* x y) -8.2e-64)
c
(if (<= (* x y) 280000000000.0)
t_1
(if (<= (* x y) 1.1e+202) t_2 (* x y)))))))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = b * (a * -0.25);
double t_2 = z * (t * 0.0625);
double tmp;
if ((x * y) <= -3.65e+140) {
tmp = x * y;
} else if ((x * y) <= -3.9e+39) {
tmp = t_1;
} else if ((x * y) <= -860000000.0) {
tmp = t_2;
} else if ((x * y) <= -8.2e-64) {
tmp = c;
} else if ((x * y) <= 280000000000.0) {
tmp = t_1;
} else if ((x * y) <= 1.1e+202) {
tmp = t_2;
} else {
tmp = x * y;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c)
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) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = b * (a * (-0.25d0))
t_2 = z * (t * 0.0625d0)
if ((x * y) <= (-3.65d+140)) then
tmp = x * y
else if ((x * y) <= (-3.9d+39)) then
tmp = t_1
else if ((x * y) <= (-860000000.0d0)) then
tmp = t_2
else if ((x * y) <= (-8.2d-64)) then
tmp = c
else if ((x * y) <= 280000000000.0d0) then
tmp = t_1
else if ((x * y) <= 1.1d+202) then
tmp = t_2
else
tmp = 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 t_1 = b * (a * -0.25);
double t_2 = z * (t * 0.0625);
double tmp;
if ((x * y) <= -3.65e+140) {
tmp = x * y;
} else if ((x * y) <= -3.9e+39) {
tmp = t_1;
} else if ((x * y) <= -860000000.0) {
tmp = t_2;
} else if ((x * y) <= -8.2e-64) {
tmp = c;
} else if ((x * y) <= 280000000000.0) {
tmp = t_1;
} else if ((x * y) <= 1.1e+202) {
tmp = t_2;
} else {
tmp = x * y;
}
return tmp;
}
def code(x, y, z, t, a, b, c): t_1 = b * (a * -0.25) t_2 = z * (t * 0.0625) tmp = 0 if (x * y) <= -3.65e+140: tmp = x * y elif (x * y) <= -3.9e+39: tmp = t_1 elif (x * y) <= -860000000.0: tmp = t_2 elif (x * y) <= -8.2e-64: tmp = c elif (x * y) <= 280000000000.0: tmp = t_1 elif (x * y) <= 1.1e+202: tmp = t_2 else: tmp = x * y return tmp
function code(x, y, z, t, a, b, c) t_1 = Float64(b * Float64(a * -0.25)) t_2 = Float64(z * Float64(t * 0.0625)) tmp = 0.0 if (Float64(x * y) <= -3.65e+140) tmp = Float64(x * y); elseif (Float64(x * y) <= -3.9e+39) tmp = t_1; elseif (Float64(x * y) <= -860000000.0) tmp = t_2; elseif (Float64(x * y) <= -8.2e-64) tmp = c; elseif (Float64(x * y) <= 280000000000.0) tmp = t_1; elseif (Float64(x * y) <= 1.1e+202) tmp = t_2; else tmp = Float64(x * y); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) t_1 = b * (a * -0.25); t_2 = z * (t * 0.0625); tmp = 0.0; if ((x * y) <= -3.65e+140) tmp = x * y; elseif ((x * y) <= -3.9e+39) tmp = t_1; elseif ((x * y) <= -860000000.0) tmp = t_2; elseif ((x * y) <= -8.2e-64) tmp = c; elseif ((x * y) <= 280000000000.0) tmp = t_1; elseif ((x * y) <= 1.1e+202) tmp = t_2; else tmp = x * y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(b * N[(a * -0.25), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(z * N[(t * 0.0625), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x * y), $MachinePrecision], -3.65e+140], N[(x * y), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], -3.9e+39], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], -860000000.0], t$95$2, If[LessEqual[N[(x * y), $MachinePrecision], -8.2e-64], c, If[LessEqual[N[(x * y), $MachinePrecision], 280000000000.0], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], 1.1e+202], t$95$2, N[(x * y), $MachinePrecision]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := b \cdot \left(a \cdot -0.25\right)\\
t_2 := z \cdot \left(t \cdot 0.0625\right)\\
\mathbf{if}\;x \cdot y \leq -3.65 \cdot 10^{+140}:\\
\;\;\;\;x \cdot y\\
\mathbf{elif}\;x \cdot y \leq -3.9 \cdot 10^{+39}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \cdot y \leq -860000000:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;x \cdot y \leq -8.2 \cdot 10^{-64}:\\
\;\;\;\;c\\
\mathbf{elif}\;x \cdot y \leq 280000000000:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \cdot y \leq 1.1 \cdot 10^{+202}:\\
\;\;\;\;t\_2\\
\mathbf{else}:\\
\;\;\;\;x \cdot y\\
\end{array}
\end{array}
if (*.f64 x y) < -3.6500000000000002e140 or 1.09999999999999989e202 < (*.f64 x y) Initial program 88.2%
Taylor expanded in z around inf 75.7%
Taylor expanded in x around inf 70.2%
if -3.6500000000000002e140 < (*.f64 x y) < -3.9000000000000001e39 or -8.2000000000000001e-64 < (*.f64 x y) < 2.8e11Initial program 100.0%
Taylor expanded in z around inf 78.9%
Taylor expanded in a around inf 45.6%
*-commutative45.6%
*-commutative45.6%
associate-*r*45.6%
Simplified45.6%
if -3.9000000000000001e39 < (*.f64 x y) < -8.6e8 or 2.8e11 < (*.f64 x y) < 1.09999999999999989e202Initial program 100.0%
Taylor expanded in z around inf 80.3%
Taylor expanded in t around inf 50.6%
if -8.6e8 < (*.f64 x y) < -8.2000000000000001e-64Initial program 100.0%
Taylor expanded in c around inf 52.1%
Final simplification53.0%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (* (* a b) 0.25)) (t_2 (* 0.0625 (* z t))))
(if (<= (* a b) -1e+137)
(- t_2 t_1)
(if (or (<= (* a b) 5e-126)
(and (not (<= (* a b) 1e-23)) (<= (* a b) 5e+46)))
(+ c (+ (* x y) t_2))
(- (+ c (* x y)) t_1)))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = (a * b) * 0.25;
double t_2 = 0.0625 * (z * t);
double tmp;
if ((a * b) <= -1e+137) {
tmp = t_2 - t_1;
} else if (((a * b) <= 5e-126) || (!((a * b) <= 1e-23) && ((a * b) <= 5e+46))) {
tmp = c + ((x * y) + t_2);
} else {
tmp = (c + (x * y)) - t_1;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c)
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) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = (a * b) * 0.25d0
t_2 = 0.0625d0 * (z * t)
if ((a * b) <= (-1d+137)) then
tmp = t_2 - t_1
else if (((a * b) <= 5d-126) .or. (.not. ((a * b) <= 1d-23)) .and. ((a * b) <= 5d+46)) then
tmp = c + ((x * y) + t_2)
else
tmp = (c + (x * y)) - t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = (a * b) * 0.25;
double t_2 = 0.0625 * (z * t);
double tmp;
if ((a * b) <= -1e+137) {
tmp = t_2 - t_1;
} else if (((a * b) <= 5e-126) || (!((a * b) <= 1e-23) && ((a * b) <= 5e+46))) {
tmp = c + ((x * y) + t_2);
} else {
tmp = (c + (x * y)) - t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c): t_1 = (a * b) * 0.25 t_2 = 0.0625 * (z * t) tmp = 0 if (a * b) <= -1e+137: tmp = t_2 - t_1 elif ((a * b) <= 5e-126) or (not ((a * b) <= 1e-23) and ((a * b) <= 5e+46)): tmp = c + ((x * y) + t_2) else: tmp = (c + (x * y)) - t_1 return tmp
function code(x, y, z, t, a, b, c) t_1 = Float64(Float64(a * b) * 0.25) t_2 = Float64(0.0625 * Float64(z * t)) tmp = 0.0 if (Float64(a * b) <= -1e+137) tmp = Float64(t_2 - t_1); elseif ((Float64(a * b) <= 5e-126) || (!(Float64(a * b) <= 1e-23) && (Float64(a * b) <= 5e+46))) tmp = Float64(c + Float64(Float64(x * y) + t_2)); else tmp = Float64(Float64(c + Float64(x * y)) - t_1); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) t_1 = (a * b) * 0.25; t_2 = 0.0625 * (z * t); tmp = 0.0; if ((a * b) <= -1e+137) tmp = t_2 - t_1; elseif (((a * b) <= 5e-126) || (~(((a * b) <= 1e-23)) && ((a * b) <= 5e+46))) tmp = c + ((x * y) + t_2); else tmp = (c + (x * y)) - t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(N[(a * b), $MachinePrecision] * 0.25), $MachinePrecision]}, Block[{t$95$2 = N[(0.0625 * N[(z * t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(a * b), $MachinePrecision], -1e+137], N[(t$95$2 - t$95$1), $MachinePrecision], If[Or[LessEqual[N[(a * b), $MachinePrecision], 5e-126], And[N[Not[LessEqual[N[(a * b), $MachinePrecision], 1e-23]], $MachinePrecision], LessEqual[N[(a * b), $MachinePrecision], 5e+46]]], N[(c + N[(N[(x * y), $MachinePrecision] + t$95$2), $MachinePrecision]), $MachinePrecision], N[(N[(c + N[(x * y), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(a \cdot b\right) \cdot 0.25\\
t_2 := 0.0625 \cdot \left(z \cdot t\right)\\
\mathbf{if}\;a \cdot b \leq -1 \cdot 10^{+137}:\\
\;\;\;\;t\_2 - t\_1\\
\mathbf{elif}\;a \cdot b \leq 5 \cdot 10^{-126} \lor \neg \left(a \cdot b \leq 10^{-23}\right) \land a \cdot b \leq 5 \cdot 10^{+46}:\\
\;\;\;\;c + \left(x \cdot y + t\_2\right)\\
\mathbf{else}:\\
\;\;\;\;\left(c + x \cdot y\right) - t\_1\\
\end{array}
\end{array}
if (*.f64 a b) < -1e137Initial program 94.3%
Taylor expanded in x around 0 94.3%
Taylor expanded in c around 0 89.0%
if -1e137 < (*.f64 a b) < 5.00000000000000006e-126 or 9.9999999999999996e-24 < (*.f64 a b) < 5.0000000000000002e46Initial program 97.7%
Taylor expanded in a around 0 91.7%
if 5.00000000000000006e-126 < (*.f64 a b) < 9.9999999999999996e-24 or 5.0000000000000002e46 < (*.f64 a b) Initial program 97.3%
Taylor expanded in z around 0 88.2%
Final simplification90.1%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (- (* x y) (* (* a b) 0.25))))
(if (<= (* x y) -2e+132)
t_1
(if (<= (* x y) 10000000000.0)
(+ c (* b (* a -0.25)))
(if (<= (* x y) 1e+187)
(+ c (* 0.0625 (* z t)))
(if (<= (* x y) 5e+290) t_1 (* x y)))))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = (x * y) - ((a * b) * 0.25);
double tmp;
if ((x * y) <= -2e+132) {
tmp = t_1;
} else if ((x * y) <= 10000000000.0) {
tmp = c + (b * (a * -0.25));
} else if ((x * y) <= 1e+187) {
tmp = c + (0.0625 * (z * t));
} else if ((x * y) <= 5e+290) {
tmp = t_1;
} else {
tmp = x * y;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c)
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) :: t_1
real(8) :: tmp
t_1 = (x * y) - ((a * b) * 0.25d0)
if ((x * y) <= (-2d+132)) then
tmp = t_1
else if ((x * y) <= 10000000000.0d0) then
tmp = c + (b * (a * (-0.25d0)))
else if ((x * y) <= 1d+187) then
tmp = c + (0.0625d0 * (z * t))
else if ((x * y) <= 5d+290) then
tmp = t_1
else
tmp = 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 t_1 = (x * y) - ((a * b) * 0.25);
double tmp;
if ((x * y) <= -2e+132) {
tmp = t_1;
} else if ((x * y) <= 10000000000.0) {
tmp = c + (b * (a * -0.25));
} else if ((x * y) <= 1e+187) {
tmp = c + (0.0625 * (z * t));
} else if ((x * y) <= 5e+290) {
tmp = t_1;
} else {
tmp = x * y;
}
return tmp;
}
def code(x, y, z, t, a, b, c): t_1 = (x * y) - ((a * b) * 0.25) tmp = 0 if (x * y) <= -2e+132: tmp = t_1 elif (x * y) <= 10000000000.0: tmp = c + (b * (a * -0.25)) elif (x * y) <= 1e+187: tmp = c + (0.0625 * (z * t)) elif (x * y) <= 5e+290: tmp = t_1 else: tmp = x * y return tmp
function code(x, y, z, t, a, b, c) t_1 = Float64(Float64(x * y) - Float64(Float64(a * b) * 0.25)) tmp = 0.0 if (Float64(x * y) <= -2e+132) tmp = t_1; elseif (Float64(x * y) <= 10000000000.0) tmp = Float64(c + Float64(b * Float64(a * -0.25))); elseif (Float64(x * y) <= 1e+187) tmp = Float64(c + Float64(0.0625 * Float64(z * t))); elseif (Float64(x * y) <= 5e+290) tmp = t_1; else tmp = Float64(x * y); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) t_1 = (x * y) - ((a * b) * 0.25); tmp = 0.0; if ((x * y) <= -2e+132) tmp = t_1; elseif ((x * y) <= 10000000000.0) tmp = c + (b * (a * -0.25)); elseif ((x * y) <= 1e+187) tmp = c + (0.0625 * (z * t)); elseif ((x * y) <= 5e+290) tmp = t_1; else tmp = x * y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(N[(x * y), $MachinePrecision] - N[(N[(a * b), $MachinePrecision] * 0.25), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x * y), $MachinePrecision], -2e+132], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], 10000000000.0], N[(c + N[(b * N[(a * -0.25), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 1e+187], N[(c + N[(0.0625 * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 5e+290], t$95$1, N[(x * y), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot y - \left(a \cdot b\right) \cdot 0.25\\
\mathbf{if}\;x \cdot y \leq -2 \cdot 10^{+132}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \cdot y \leq 10000000000:\\
\;\;\;\;c + b \cdot \left(a \cdot -0.25\right)\\
\mathbf{elif}\;x \cdot y \leq 10^{+187}:\\
\;\;\;\;c + 0.0625 \cdot \left(z \cdot t\right)\\
\mathbf{elif}\;x \cdot y \leq 5 \cdot 10^{+290}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;x \cdot y\\
\end{array}
\end{array}
if (*.f64 x y) < -1.99999999999999998e132 or 9.99999999999999907e186 < (*.f64 x y) < 4.9999999999999998e290Initial program 90.2%
Taylor expanded in z around 0 84.0%
Taylor expanded in c around 0 80.1%
if -1.99999999999999998e132 < (*.f64 x y) < 1e10Initial program 100.0%
Taylor expanded in a around inf 69.1%
associate-*r*69.1%
*-commutative69.1%
*-commutative69.1%
Simplified69.1%
if 1e10 < (*.f64 x y) < 9.99999999999999907e186Initial program 100.0%
Taylor expanded in a around 0 81.2%
Taylor expanded in x around 0 74.0%
if 4.9999999999999998e290 < (*.f64 x y) Initial program 85.0%
Taylor expanded in z around inf 74.9%
Taylor expanded in x around inf 90.0%
Final simplification73.3%
(FPCore (x y z t a b c) :precision binary64 (let* ((t_1 (- (+ (* x y) (/ (* z t) 16.0)) (/ (* a b) 4.0)))) (if (<= t_1 INFINITY) (+ c t_1) (- (* 0.0625 (* z t)) (* (* a b) 0.25)))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = ((x * y) + ((z * t) / 16.0)) - ((a * b) / 4.0);
double tmp;
if (t_1 <= ((double) INFINITY)) {
tmp = c + t_1;
} else {
tmp = (0.0625 * (z * t)) - ((a * b) * 0.25);
}
return tmp;
}
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = ((x * y) + ((z * t) / 16.0)) - ((a * b) / 4.0);
double tmp;
if (t_1 <= Double.POSITIVE_INFINITY) {
tmp = c + t_1;
} else {
tmp = (0.0625 * (z * t)) - ((a * b) * 0.25);
}
return tmp;
}
def code(x, y, z, t, a, b, c): t_1 = ((x * y) + ((z * t) / 16.0)) - ((a * b) / 4.0) tmp = 0 if t_1 <= math.inf: tmp = c + t_1 else: tmp = (0.0625 * (z * t)) - ((a * b) * 0.25) return tmp
function code(x, y, z, t, a, b, c) t_1 = Float64(Float64(Float64(x * y) + Float64(Float64(z * t) / 16.0)) - Float64(Float64(a * b) / 4.0)) tmp = 0.0 if (t_1 <= Inf) tmp = Float64(c + t_1); else tmp = Float64(Float64(0.0625 * Float64(z * t)) - Float64(Float64(a * b) * 0.25)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) t_1 = ((x * y) + ((z * t) / 16.0)) - ((a * b) / 4.0); tmp = 0.0; if (t_1 <= Inf) tmp = c + t_1; else tmp = (0.0625 * (z * t)) - ((a * b) * 0.25); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(N[(N[(x * y), $MachinePrecision] + N[(N[(z * t), $MachinePrecision] / 16.0), $MachinePrecision]), $MachinePrecision] - N[(N[(a * b), $MachinePrecision] / 4.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, Infinity], N[(c + t$95$1), $MachinePrecision], N[(N[(0.0625 * N[(z * t), $MachinePrecision]), $MachinePrecision] - N[(N[(a * b), $MachinePrecision] * 0.25), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(x \cdot y + \frac{z \cdot t}{16}\right) - \frac{a \cdot b}{4}\\
\mathbf{if}\;t\_1 \leq \infty:\\
\;\;\;\;c + t\_1\\
\mathbf{else}:\\
\;\;\;\;0.0625 \cdot \left(z \cdot t\right) - \left(a \cdot b\right) \cdot 0.25\\
\end{array}
\end{array}
if (-.f64 (+.f64 (*.f64 x y) (/.f64 (*.f64 z t) #s(literal 16 binary64))) (/.f64 (*.f64 a b) #s(literal 4 binary64))) < +inf.0Initial program 100.0%
if +inf.0 < (-.f64 (+.f64 (*.f64 x y) (/.f64 (*.f64 z t) #s(literal 16 binary64))) (/.f64 (*.f64 a b) #s(literal 4 binary64))) Initial program 0.0%
Taylor expanded in x around 0 62.5%
Taylor expanded in c around 0 62.5%
Final simplification98.8%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (+ c (* x y))) (t_2 (* b (* a -0.25))))
(if (<= b -1.25e+54)
t_2
(if (<= b 1.55e-209)
t_1
(if (<= b 5.1e-40)
(+ c (* 0.0625 (* z t)))
(if (or (<= b 2.4e+49) (and (not (<= b 5e+98)) (<= b 1.4e+158)))
t_1
t_2))))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = c + (x * y);
double t_2 = b * (a * -0.25);
double tmp;
if (b <= -1.25e+54) {
tmp = t_2;
} else if (b <= 1.55e-209) {
tmp = t_1;
} else if (b <= 5.1e-40) {
tmp = c + (0.0625 * (z * t));
} else if ((b <= 2.4e+49) || (!(b <= 5e+98) && (b <= 1.4e+158))) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c)
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) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = c + (x * y)
t_2 = b * (a * (-0.25d0))
if (b <= (-1.25d+54)) then
tmp = t_2
else if (b <= 1.55d-209) then
tmp = t_1
else if (b <= 5.1d-40) then
tmp = c + (0.0625d0 * (z * t))
else if ((b <= 2.4d+49) .or. (.not. (b <= 5d+98)) .and. (b <= 1.4d+158)) 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 t_1 = c + (x * y);
double t_2 = b * (a * -0.25);
double tmp;
if (b <= -1.25e+54) {
tmp = t_2;
} else if (b <= 1.55e-209) {
tmp = t_1;
} else if (b <= 5.1e-40) {
tmp = c + (0.0625 * (z * t));
} else if ((b <= 2.4e+49) || (!(b <= 5e+98) && (b <= 1.4e+158))) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b, c): t_1 = c + (x * y) t_2 = b * (a * -0.25) tmp = 0 if b <= -1.25e+54: tmp = t_2 elif b <= 1.55e-209: tmp = t_1 elif b <= 5.1e-40: tmp = c + (0.0625 * (z * t)) elif (b <= 2.4e+49) or (not (b <= 5e+98) and (b <= 1.4e+158)): tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t, a, b, c) t_1 = Float64(c + Float64(x * y)) t_2 = Float64(b * Float64(a * -0.25)) tmp = 0.0 if (b <= -1.25e+54) tmp = t_2; elseif (b <= 1.55e-209) tmp = t_1; elseif (b <= 5.1e-40) tmp = Float64(c + Float64(0.0625 * Float64(z * t))); elseif ((b <= 2.4e+49) || (!(b <= 5e+98) && (b <= 1.4e+158))) tmp = t_1; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) t_1 = c + (x * y); t_2 = b * (a * -0.25); tmp = 0.0; if (b <= -1.25e+54) tmp = t_2; elseif (b <= 1.55e-209) tmp = t_1; elseif (b <= 5.1e-40) tmp = c + (0.0625 * (z * t)); elseif ((b <= 2.4e+49) || (~((b <= 5e+98)) && (b <= 1.4e+158))) tmp = t_1; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(c + N[(x * y), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(b * N[(a * -0.25), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[b, -1.25e+54], t$95$2, If[LessEqual[b, 1.55e-209], t$95$1, If[LessEqual[b, 5.1e-40], N[(c + N[(0.0625 * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[b, 2.4e+49], And[N[Not[LessEqual[b, 5e+98]], $MachinePrecision], LessEqual[b, 1.4e+158]]], t$95$1, t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := c + x \cdot y\\
t_2 := b \cdot \left(a \cdot -0.25\right)\\
\mathbf{if}\;b \leq -1.25 \cdot 10^{+54}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;b \leq 1.55 \cdot 10^{-209}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;b \leq 5.1 \cdot 10^{-40}:\\
\;\;\;\;c + 0.0625 \cdot \left(z \cdot t\right)\\
\mathbf{elif}\;b \leq 2.4 \cdot 10^{+49} \lor \neg \left(b \leq 5 \cdot 10^{+98}\right) \land b \leq 1.4 \cdot 10^{+158}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if b < -1.25000000000000001e54 or 2.4e49 < b < 4.9999999999999998e98 or 1.40000000000000001e158 < b Initial program 94.9%
Taylor expanded in z around inf 75.0%
Taylor expanded in a around inf 63.3%
*-commutative63.3%
*-commutative63.3%
associate-*r*63.3%
Simplified63.3%
if -1.25000000000000001e54 < b < 1.55e-209 or 5.10000000000000037e-40 < b < 2.4e49 or 4.9999999999999998e98 < b < 1.40000000000000001e158Initial program 97.5%
Taylor expanded in a around 0 83.2%
Taylor expanded in t around 0 63.8%
if 1.55e-209 < b < 5.10000000000000037e-40Initial program 100.0%
Taylor expanded in a around 0 86.2%
Taylor expanded in x around 0 72.6%
Final simplification64.8%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (+ c (* x y))))
(if (<= (* x y) -2e+145)
t_1
(if (<= (* x y) 10000000000.0)
(+ c (* b (* a -0.25)))
(if (<= (* x y) 2e+202) (+ c (* 0.0625 (* z t))) t_1)))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = c + (x * y);
double tmp;
if ((x * y) <= -2e+145) {
tmp = t_1;
} else if ((x * y) <= 10000000000.0) {
tmp = c + (b * (a * -0.25));
} else if ((x * y) <= 2e+202) {
tmp = c + (0.0625 * (z * t));
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c)
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) :: t_1
real(8) :: tmp
t_1 = c + (x * y)
if ((x * y) <= (-2d+145)) then
tmp = t_1
else if ((x * y) <= 10000000000.0d0) then
tmp = c + (b * (a * (-0.25d0)))
else if ((x * y) <= 2d+202) then
tmp = c + (0.0625d0 * (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 t_1 = c + (x * y);
double tmp;
if ((x * y) <= -2e+145) {
tmp = t_1;
} else if ((x * y) <= 10000000000.0) {
tmp = c + (b * (a * -0.25));
} else if ((x * y) <= 2e+202) {
tmp = c + (0.0625 * (z * t));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c): t_1 = c + (x * y) tmp = 0 if (x * y) <= -2e+145: tmp = t_1 elif (x * y) <= 10000000000.0: tmp = c + (b * (a * -0.25)) elif (x * y) <= 2e+202: tmp = c + (0.0625 * (z * t)) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b, c) t_1 = Float64(c + Float64(x * y)) tmp = 0.0 if (Float64(x * y) <= -2e+145) tmp = t_1; elseif (Float64(x * y) <= 10000000000.0) tmp = Float64(c + Float64(b * Float64(a * -0.25))); elseif (Float64(x * y) <= 2e+202) tmp = Float64(c + Float64(0.0625 * Float64(z * t))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) t_1 = c + (x * y); tmp = 0.0; if ((x * y) <= -2e+145) tmp = t_1; elseif ((x * y) <= 10000000000.0) tmp = c + (b * (a * -0.25)); elseif ((x * y) <= 2e+202) tmp = c + (0.0625 * (z * t)); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(c + N[(x * y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x * y), $MachinePrecision], -2e+145], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], 10000000000.0], N[(c + N[(b * N[(a * -0.25), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 2e+202], N[(c + N[(0.0625 * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := c + x \cdot y\\
\mathbf{if}\;x \cdot y \leq -2 \cdot 10^{+145}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \cdot y \leq 10000000000:\\
\;\;\;\;c + b \cdot \left(a \cdot -0.25\right)\\
\mathbf{elif}\;x \cdot y \leq 2 \cdot 10^{+202}:\\
\;\;\;\;c + 0.0625 \cdot \left(z \cdot t\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (*.f64 x y) < -2e145 or 1.9999999999999998e202 < (*.f64 x y) Initial program 88.2%
Taylor expanded in a around 0 77.4%
Taylor expanded in t around 0 73.1%
if -2e145 < (*.f64 x y) < 1e10Initial program 100.0%
Taylor expanded in a around inf 69.4%
associate-*r*69.4%
*-commutative69.4%
*-commutative69.4%
Simplified69.4%
if 1e10 < (*.f64 x y) < 1.9999999999999998e202Initial program 100.0%
Taylor expanded in a around 0 77.5%
Taylor expanded in x around 0 70.6%
Final simplification70.5%
(FPCore (x y z t a b c)
:precision binary64
(if (or (<= b -1.5e+54)
(and (not (<= b 3.6e+50)) (or (<= b 2.7e+99) (not (<= b 4.5e+158)))))
(* b (* a -0.25))
(+ c (* x y))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if ((b <= -1.5e+54) || (!(b <= 3.6e+50) && ((b <= 2.7e+99) || !(b <= 4.5e+158)))) {
tmp = b * (a * -0.25);
} else {
tmp = c + (x * y);
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c)
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) :: tmp
if ((b <= (-1.5d+54)) .or. (.not. (b <= 3.6d+50)) .and. (b <= 2.7d+99) .or. (.not. (b <= 4.5d+158))) then
tmp = b * (a * (-0.25d0))
else
tmp = c + (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 tmp;
if ((b <= -1.5e+54) || (!(b <= 3.6e+50) && ((b <= 2.7e+99) || !(b <= 4.5e+158)))) {
tmp = b * (a * -0.25);
} else {
tmp = c + (x * y);
}
return tmp;
}
def code(x, y, z, t, a, b, c): tmp = 0 if (b <= -1.5e+54) or (not (b <= 3.6e+50) and ((b <= 2.7e+99) or not (b <= 4.5e+158))): tmp = b * (a * -0.25) else: tmp = c + (x * y) return tmp
function code(x, y, z, t, a, b, c) tmp = 0.0 if ((b <= -1.5e+54) || (!(b <= 3.6e+50) && ((b <= 2.7e+99) || !(b <= 4.5e+158)))) tmp = Float64(b * Float64(a * -0.25)); else tmp = Float64(c + Float64(x * y)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) tmp = 0.0; if ((b <= -1.5e+54) || (~((b <= 3.6e+50)) && ((b <= 2.7e+99) || ~((b <= 4.5e+158))))) tmp = b * (a * -0.25); else tmp = c + (x * y); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := If[Or[LessEqual[b, -1.5e+54], And[N[Not[LessEqual[b, 3.6e+50]], $MachinePrecision], Or[LessEqual[b, 2.7e+99], N[Not[LessEqual[b, 4.5e+158]], $MachinePrecision]]]], N[(b * N[(a * -0.25), $MachinePrecision]), $MachinePrecision], N[(c + N[(x * y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -1.5 \cdot 10^{+54} \lor \neg \left(b \leq 3.6 \cdot 10^{+50}\right) \land \left(b \leq 2.7 \cdot 10^{+99} \lor \neg \left(b \leq 4.5 \cdot 10^{+158}\right)\right):\\
\;\;\;\;b \cdot \left(a \cdot -0.25\right)\\
\mathbf{else}:\\
\;\;\;\;c + x \cdot y\\
\end{array}
\end{array}
if b < -1.4999999999999999e54 or 3.59999999999999986e50 < b < 2.69999999999999989e99 or 4.50000000000000046e158 < b Initial program 94.9%
Taylor expanded in z around inf 75.0%
Taylor expanded in a around inf 63.3%
*-commutative63.3%
*-commutative63.3%
associate-*r*63.3%
Simplified63.3%
if -1.4999999999999999e54 < b < 3.59999999999999986e50 or 2.69999999999999989e99 < b < 4.50000000000000046e158Initial program 98.1%
Taylor expanded in a around 0 83.9%
Taylor expanded in t around 0 57.6%
Final simplification59.8%
(FPCore (x y z t a b c) :precision binary64 (if (or (<= (* a b) -5e+158) (not (<= (* a b) 5e+93))) (+ c (* b (* a -0.25))) (+ c (+ (* x y) (* 0.0625 (* z t))))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if (((a * b) <= -5e+158) || !((a * b) <= 5e+93)) {
tmp = c + (b * (a * -0.25));
} else {
tmp = c + ((x * y) + (0.0625 * (z * t)));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c)
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) :: tmp
if (((a * b) <= (-5d+158)) .or. (.not. ((a * b) <= 5d+93))) then
tmp = c + (b * (a * (-0.25d0)))
else
tmp = c + ((x * y) + (0.0625d0 * (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 tmp;
if (((a * b) <= -5e+158) || !((a * b) <= 5e+93)) {
tmp = c + (b * (a * -0.25));
} else {
tmp = c + ((x * y) + (0.0625 * (z * t)));
}
return tmp;
}
def code(x, y, z, t, a, b, c): tmp = 0 if ((a * b) <= -5e+158) or not ((a * b) <= 5e+93): tmp = c + (b * (a * -0.25)) else: tmp = c + ((x * y) + (0.0625 * (z * t))) return tmp
function code(x, y, z, t, a, b, c) tmp = 0.0 if ((Float64(a * b) <= -5e+158) || !(Float64(a * b) <= 5e+93)) tmp = Float64(c + Float64(b * Float64(a * -0.25))); else tmp = Float64(c + Float64(Float64(x * y) + Float64(0.0625 * Float64(z * t)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) tmp = 0.0; if (((a * b) <= -5e+158) || ~(((a * b) <= 5e+93))) tmp = c + (b * (a * -0.25)); else tmp = c + ((x * y) + (0.0625 * (z * t))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := If[Or[LessEqual[N[(a * b), $MachinePrecision], -5e+158], N[Not[LessEqual[N[(a * b), $MachinePrecision], 5e+93]], $MachinePrecision]], N[(c + N[(b * N[(a * -0.25), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(c + N[(N[(x * y), $MachinePrecision] + N[(0.0625 * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \cdot b \leq -5 \cdot 10^{+158} \lor \neg \left(a \cdot b \leq 5 \cdot 10^{+93}\right):\\
\;\;\;\;c + b \cdot \left(a \cdot -0.25\right)\\
\mathbf{else}:\\
\;\;\;\;c + \left(x \cdot y + 0.0625 \cdot \left(z \cdot t\right)\right)\\
\end{array}
\end{array}
if (*.f64 a b) < -4.9999999999999996e158 or 5.0000000000000001e93 < (*.f64 a b) Initial program 94.6%
Taylor expanded in a around inf 82.9%
associate-*r*82.9%
*-commutative82.9%
*-commutative82.9%
Simplified82.9%
if -4.9999999999999996e158 < (*.f64 a b) < 5.0000000000000001e93Initial program 98.1%
Taylor expanded in a around 0 86.8%
Final simplification85.4%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (* 0.0625 (* z t))))
(if (<= (* a b) -1e+137)
(- t_1 (* (* a b) 0.25))
(if (<= (* a b) 5e+93) (+ c (+ (* x y) t_1)) (+ c (* b (* a -0.25)))))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = 0.0625 * (z * t);
double tmp;
if ((a * b) <= -1e+137) {
tmp = t_1 - ((a * b) * 0.25);
} else if ((a * b) <= 5e+93) {
tmp = c + ((x * y) + t_1);
} else {
tmp = c + (b * (a * -0.25));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c)
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) :: t_1
real(8) :: tmp
t_1 = 0.0625d0 * (z * t)
if ((a * b) <= (-1d+137)) then
tmp = t_1 - ((a * b) * 0.25d0)
else if ((a * b) <= 5d+93) then
tmp = c + ((x * y) + t_1)
else
tmp = c + (b * (a * (-0.25d0)))
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 t_1 = 0.0625 * (z * t);
double tmp;
if ((a * b) <= -1e+137) {
tmp = t_1 - ((a * b) * 0.25);
} else if ((a * b) <= 5e+93) {
tmp = c + ((x * y) + t_1);
} else {
tmp = c + (b * (a * -0.25));
}
return tmp;
}
def code(x, y, z, t, a, b, c): t_1 = 0.0625 * (z * t) tmp = 0 if (a * b) <= -1e+137: tmp = t_1 - ((a * b) * 0.25) elif (a * b) <= 5e+93: tmp = c + ((x * y) + t_1) else: tmp = c + (b * (a * -0.25)) return tmp
function code(x, y, z, t, a, b, c) t_1 = Float64(0.0625 * Float64(z * t)) tmp = 0.0 if (Float64(a * b) <= -1e+137) tmp = Float64(t_1 - Float64(Float64(a * b) * 0.25)); elseif (Float64(a * b) <= 5e+93) tmp = Float64(c + Float64(Float64(x * y) + t_1)); else tmp = Float64(c + Float64(b * Float64(a * -0.25))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) t_1 = 0.0625 * (z * t); tmp = 0.0; if ((a * b) <= -1e+137) tmp = t_1 - ((a * b) * 0.25); elseif ((a * b) <= 5e+93) tmp = c + ((x * y) + t_1); else tmp = c + (b * (a * -0.25)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(0.0625 * N[(z * t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(a * b), $MachinePrecision], -1e+137], N[(t$95$1 - N[(N[(a * b), $MachinePrecision] * 0.25), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(a * b), $MachinePrecision], 5e+93], N[(c + N[(N[(x * y), $MachinePrecision] + t$95$1), $MachinePrecision]), $MachinePrecision], N[(c + N[(b * N[(a * -0.25), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := 0.0625 \cdot \left(z \cdot t\right)\\
\mathbf{if}\;a \cdot b \leq -1 \cdot 10^{+137}:\\
\;\;\;\;t\_1 - \left(a \cdot b\right) \cdot 0.25\\
\mathbf{elif}\;a \cdot b \leq 5 \cdot 10^{+93}:\\
\;\;\;\;c + \left(x \cdot y + t\_1\right)\\
\mathbf{else}:\\
\;\;\;\;c + b \cdot \left(a \cdot -0.25\right)\\
\end{array}
\end{array}
if (*.f64 a b) < -1e137Initial program 94.3%
Taylor expanded in x around 0 94.3%
Taylor expanded in c around 0 89.0%
if -1e137 < (*.f64 a b) < 5.0000000000000001e93Initial program 98.1%
Taylor expanded in a around 0 87.6%
if 5.0000000000000001e93 < (*.f64 a b) Initial program 95.6%
Taylor expanded in a around inf 82.5%
associate-*r*82.5%
*-commutative82.5%
*-commutative82.5%
Simplified82.5%
Final simplification87.0%
(FPCore (x y z t a b c) :precision binary64 (if (or (<= (* x y) -2e+145) (not (<= (* x y) 2e+133))) (+ (* x y) (* 0.0625 (* z t))) (+ c (* b (* a -0.25)))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if (((x * y) <= -2e+145) || !((x * y) <= 2e+133)) {
tmp = (x * y) + (0.0625 * (z * t));
} else {
tmp = c + (b * (a * -0.25));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c)
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) :: tmp
if (((x * y) <= (-2d+145)) .or. (.not. ((x * y) <= 2d+133))) then
tmp = (x * y) + (0.0625d0 * (z * t))
else
tmp = c + (b * (a * (-0.25d0)))
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 tmp;
if (((x * y) <= -2e+145) || !((x * y) <= 2e+133)) {
tmp = (x * y) + (0.0625 * (z * t));
} else {
tmp = c + (b * (a * -0.25));
}
return tmp;
}
def code(x, y, z, t, a, b, c): tmp = 0 if ((x * y) <= -2e+145) or not ((x * y) <= 2e+133): tmp = (x * y) + (0.0625 * (z * t)) else: tmp = c + (b * (a * -0.25)) return tmp
function code(x, y, z, t, a, b, c) tmp = 0.0 if ((Float64(x * y) <= -2e+145) || !(Float64(x * y) <= 2e+133)) tmp = Float64(Float64(x * y) + Float64(0.0625 * Float64(z * t))); else tmp = Float64(c + Float64(b * Float64(a * -0.25))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) tmp = 0.0; if (((x * y) <= -2e+145) || ~(((x * y) <= 2e+133))) tmp = (x * y) + (0.0625 * (z * t)); else tmp = c + (b * (a * -0.25)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := If[Or[LessEqual[N[(x * y), $MachinePrecision], -2e+145], N[Not[LessEqual[N[(x * y), $MachinePrecision], 2e+133]], $MachinePrecision]], N[(N[(x * y), $MachinePrecision] + N[(0.0625 * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(c + N[(b * N[(a * -0.25), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \cdot y \leq -2 \cdot 10^{+145} \lor \neg \left(x \cdot y \leq 2 \cdot 10^{+133}\right):\\
\;\;\;\;x \cdot y + 0.0625 \cdot \left(z \cdot t\right)\\
\mathbf{else}:\\
\;\;\;\;c + b \cdot \left(a \cdot -0.25\right)\\
\end{array}
\end{array}
if (*.f64 x y) < -2e145 or 2e133 < (*.f64 x y) Initial program 89.9%
Taylor expanded in a around 0 76.7%
Taylor expanded in c around 0 74.2%
if -2e145 < (*.f64 x y) < 2e133Initial program 100.0%
Taylor expanded in a around inf 69.1%
associate-*r*69.1%
*-commutative69.1%
*-commutative69.1%
Simplified69.1%
Final simplification70.7%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (* (* a b) 0.25)) (t_2 (* 0.0625 (* z t))))
(if (<= x -2.1e+179)
(- (+ c (* x y)) t_1)
(if (<= x 1.6e-77) (- (+ c t_2) t_1) (+ c (+ (* x y) t_2))))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = (a * b) * 0.25;
double t_2 = 0.0625 * (z * t);
double tmp;
if (x <= -2.1e+179) {
tmp = (c + (x * y)) - t_1;
} else if (x <= 1.6e-77) {
tmp = (c + t_2) - t_1;
} else {
tmp = c + ((x * y) + t_2);
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c)
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) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = (a * b) * 0.25d0
t_2 = 0.0625d0 * (z * t)
if (x <= (-2.1d+179)) then
tmp = (c + (x * y)) - t_1
else if (x <= 1.6d-77) then
tmp = (c + t_2) - t_1
else
tmp = c + ((x * y) + 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 t_1 = (a * b) * 0.25;
double t_2 = 0.0625 * (z * t);
double tmp;
if (x <= -2.1e+179) {
tmp = (c + (x * y)) - t_1;
} else if (x <= 1.6e-77) {
tmp = (c + t_2) - t_1;
} else {
tmp = c + ((x * y) + t_2);
}
return tmp;
}
def code(x, y, z, t, a, b, c): t_1 = (a * b) * 0.25 t_2 = 0.0625 * (z * t) tmp = 0 if x <= -2.1e+179: tmp = (c + (x * y)) - t_1 elif x <= 1.6e-77: tmp = (c + t_2) - t_1 else: tmp = c + ((x * y) + t_2) return tmp
function code(x, y, z, t, a, b, c) t_1 = Float64(Float64(a * b) * 0.25) t_2 = Float64(0.0625 * Float64(z * t)) tmp = 0.0 if (x <= -2.1e+179) tmp = Float64(Float64(c + Float64(x * y)) - t_1); elseif (x <= 1.6e-77) tmp = Float64(Float64(c + t_2) - t_1); else tmp = Float64(c + Float64(Float64(x * y) + t_2)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) t_1 = (a * b) * 0.25; t_2 = 0.0625 * (z * t); tmp = 0.0; if (x <= -2.1e+179) tmp = (c + (x * y)) - t_1; elseif (x <= 1.6e-77) tmp = (c + t_2) - t_1; else tmp = c + ((x * y) + t_2); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(N[(a * b), $MachinePrecision] * 0.25), $MachinePrecision]}, Block[{t$95$2 = N[(0.0625 * N[(z * t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -2.1e+179], N[(N[(c + N[(x * y), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision], If[LessEqual[x, 1.6e-77], N[(N[(c + t$95$2), $MachinePrecision] - t$95$1), $MachinePrecision], N[(c + N[(N[(x * y), $MachinePrecision] + t$95$2), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(a \cdot b\right) \cdot 0.25\\
t_2 := 0.0625 \cdot \left(z \cdot t\right)\\
\mathbf{if}\;x \leq -2.1 \cdot 10^{+179}:\\
\;\;\;\;\left(c + x \cdot y\right) - t\_1\\
\mathbf{elif}\;x \leq 1.6 \cdot 10^{-77}:\\
\;\;\;\;\left(c + t\_2\right) - t\_1\\
\mathbf{else}:\\
\;\;\;\;c + \left(x \cdot y + t\_2\right)\\
\end{array}
\end{array}
if x < -2.0999999999999999e179Initial program 80.0%
Taylor expanded in z around 0 88.0%
if -2.0999999999999999e179 < x < 1.6e-77Initial program 98.5%
Taylor expanded in x around 0 90.6%
if 1.6e-77 < x Initial program 98.9%
Taylor expanded in a around 0 71.2%
Final simplification83.4%
(FPCore (x y z t a b c) :precision binary64 (if (or (<= (* x y) -7.5e+142) (not (<= (* x y) 1.1e+202))) (* x y) (* b (* a -0.25))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if (((x * y) <= -7.5e+142) || !((x * y) <= 1.1e+202)) {
tmp = x * y;
} else {
tmp = b * (a * -0.25);
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c)
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) :: tmp
if (((x * y) <= (-7.5d+142)) .or. (.not. ((x * y) <= 1.1d+202))) then
tmp = x * y
else
tmp = b * (a * (-0.25d0))
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 tmp;
if (((x * y) <= -7.5e+142) || !((x * y) <= 1.1e+202)) {
tmp = x * y;
} else {
tmp = b * (a * -0.25);
}
return tmp;
}
def code(x, y, z, t, a, b, c): tmp = 0 if ((x * y) <= -7.5e+142) or not ((x * y) <= 1.1e+202): tmp = x * y else: tmp = b * (a * -0.25) return tmp
function code(x, y, z, t, a, b, c) tmp = 0.0 if ((Float64(x * y) <= -7.5e+142) || !(Float64(x * y) <= 1.1e+202)) tmp = Float64(x * y); else tmp = Float64(b * Float64(a * -0.25)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) tmp = 0.0; if (((x * y) <= -7.5e+142) || ~(((x * y) <= 1.1e+202))) tmp = x * y; else tmp = b * (a * -0.25); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := If[Or[LessEqual[N[(x * y), $MachinePrecision], -7.5e+142], N[Not[LessEqual[N[(x * y), $MachinePrecision], 1.1e+202]], $MachinePrecision]], N[(x * y), $MachinePrecision], N[(b * N[(a * -0.25), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \cdot y \leq -7.5 \cdot 10^{+142} \lor \neg \left(x \cdot y \leq 1.1 \cdot 10^{+202}\right):\\
\;\;\;\;x \cdot y\\
\mathbf{else}:\\
\;\;\;\;b \cdot \left(a \cdot -0.25\right)\\
\end{array}
\end{array}
if (*.f64 x y) < -7.5000000000000002e142 or 1.09999999999999989e202 < (*.f64 x y) Initial program 88.2%
Taylor expanded in z around inf 75.7%
Taylor expanded in x around inf 70.2%
if -7.5000000000000002e142 < (*.f64 x y) < 1.09999999999999989e202Initial program 100.0%
Taylor expanded in z around inf 78.8%
Taylor expanded in a around inf 40.6%
*-commutative40.6%
*-commutative40.6%
associate-*r*40.6%
Simplified40.6%
Final simplification48.5%
(FPCore (x y z t a b c) :precision binary64 (if (or (<= (* x y) -3.2e+135) (not (<= (* x y) 1.35e+97))) (* x y) c))
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if (((x * y) <= -3.2e+135) || !((x * y) <= 1.35e+97)) {
tmp = x * y;
} else {
tmp = c;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c)
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) :: tmp
if (((x * y) <= (-3.2d+135)) .or. (.not. ((x * y) <= 1.35d+97))) then
tmp = x * y
else
tmp = 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 tmp;
if (((x * y) <= -3.2e+135) || !((x * y) <= 1.35e+97)) {
tmp = x * y;
} else {
tmp = c;
}
return tmp;
}
def code(x, y, z, t, a, b, c): tmp = 0 if ((x * y) <= -3.2e+135) or not ((x * y) <= 1.35e+97): tmp = x * y else: tmp = c return tmp
function code(x, y, z, t, a, b, c) tmp = 0.0 if ((Float64(x * y) <= -3.2e+135) || !(Float64(x * y) <= 1.35e+97)) tmp = Float64(x * y); else tmp = c; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) tmp = 0.0; if (((x * y) <= -3.2e+135) || ~(((x * y) <= 1.35e+97))) tmp = x * y; else tmp = c; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := If[Or[LessEqual[N[(x * y), $MachinePrecision], -3.2e+135], N[Not[LessEqual[N[(x * y), $MachinePrecision], 1.35e+97]], $MachinePrecision]], N[(x * y), $MachinePrecision], c]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \cdot y \leq -3.2 \cdot 10^{+135} \lor \neg \left(x \cdot y \leq 1.35 \cdot 10^{+97}\right):\\
\;\;\;\;x \cdot y\\
\mathbf{else}:\\
\;\;\;\;c\\
\end{array}
\end{array}
if (*.f64 x y) < -3.19999999999999975e135 or 1.34999999999999997e97 < (*.f64 x y) Initial program 90.0%
Taylor expanded in z around inf 78.1%
Taylor expanded in x around inf 61.4%
if -3.19999999999999975e135 < (*.f64 x y) < 1.34999999999999997e97Initial program 100.0%
Taylor expanded in c around inf 30.7%
Final simplification40.3%
(FPCore (x y z t a b c) :precision binary64 c)
double code(double x, double y, double z, double t, double a, double b, double c) {
return c;
}
real(8) function code(x, y, z, t, a, b, c)
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
code = c
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
return c;
}
def code(x, y, z, t, a, b, c): return c
function code(x, y, z, t, a, b, c) return c end
function tmp = code(x, y, z, t, a, b, c) tmp = c; end
code[x_, y_, z_, t_, a_, b_, c_] := c
\begin{array}{l}
\\
c
\end{array}
Initial program 96.9%
Taylor expanded in c around inf 22.6%
herbie shell --seed 2024084
(FPCore (x y z t a b c)
:name "Diagrams.Solve.Polynomial:quartForm from diagrams-solve-0.1, C"
:precision binary64
(+ (- (+ (* x y) (/ (* z t) 16.0)) (/ (* a b) 4.0)) c))