
(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 14 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 97.6%
associate--l+97.6%
fma-define98.4%
associate-/l*98.4%
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 97.6%
associate-+l-97.6%
*-commutative97.6%
associate-+l-97.6%
fma-define98.0%
*-commutative98.0%
associate-/l*98.0%
associate-/l*98.0%
Simplified98.0%
Final simplification98.0%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (- (* x y) (* (* a b) 0.25))))
(if (<= (* a b) -4e+46)
t_1
(if (<= (* a b) -2e-43)
(+ c (* x y))
(if (<= (* a b) -1e-315)
(* z (+ (* t 0.0625) (/ (* x y) z)))
(if (<= (* a b) 2e+127) (+ c (* t (* z 0.0625))) t_1))))))
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 ((a * b) <= -4e+46) {
tmp = t_1;
} else if ((a * b) <= -2e-43) {
tmp = c + (x * y);
} else if ((a * b) <= -1e-315) {
tmp = z * ((t * 0.0625) + ((x * y) / z));
} else if ((a * b) <= 2e+127) {
tmp = c + (t * (z * 0.0625));
} 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 = (x * y) - ((a * b) * 0.25d0)
if ((a * b) <= (-4d+46)) then
tmp = t_1
else if ((a * b) <= (-2d-43)) then
tmp = c + (x * y)
else if ((a * b) <= (-1d-315)) then
tmp = z * ((t * 0.0625d0) + ((x * y) / z))
else if ((a * b) <= 2d+127) then
tmp = c + (t * (z * 0.0625d0))
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 = (x * y) - ((a * b) * 0.25);
double tmp;
if ((a * b) <= -4e+46) {
tmp = t_1;
} else if ((a * b) <= -2e-43) {
tmp = c + (x * y);
} else if ((a * b) <= -1e-315) {
tmp = z * ((t * 0.0625) + ((x * y) / z));
} else if ((a * b) <= 2e+127) {
tmp = c + (t * (z * 0.0625));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c): t_1 = (x * y) - ((a * b) * 0.25) tmp = 0 if (a * b) <= -4e+46: tmp = t_1 elif (a * b) <= -2e-43: tmp = c + (x * y) elif (a * b) <= -1e-315: tmp = z * ((t * 0.0625) + ((x * y) / z)) elif (a * b) <= 2e+127: tmp = c + (t * (z * 0.0625)) else: tmp = t_1 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(a * b) <= -4e+46) tmp = t_1; elseif (Float64(a * b) <= -2e-43) tmp = Float64(c + Float64(x * y)); elseif (Float64(a * b) <= -1e-315) tmp = Float64(z * Float64(Float64(t * 0.0625) + Float64(Float64(x * y) / z))); elseif (Float64(a * b) <= 2e+127) tmp = Float64(c + Float64(t * Float64(z * 0.0625))); else tmp = t_1; 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 ((a * b) <= -4e+46) tmp = t_1; elseif ((a * b) <= -2e-43) tmp = c + (x * y); elseif ((a * b) <= -1e-315) tmp = z * ((t * 0.0625) + ((x * y) / z)); elseif ((a * b) <= 2e+127) tmp = c + (t * (z * 0.0625)); else tmp = t_1; 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[(a * b), $MachinePrecision], -4e+46], t$95$1, If[LessEqual[N[(a * b), $MachinePrecision], -2e-43], N[(c + N[(x * y), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(a * b), $MachinePrecision], -1e-315], N[(z * N[(N[(t * 0.0625), $MachinePrecision] + N[(N[(x * y), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(a * b), $MachinePrecision], 2e+127], N[(c + N[(t * N[(z * 0.0625), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot y - \left(a \cdot b\right) \cdot 0.25\\
\mathbf{if}\;a \cdot b \leq -4 \cdot 10^{+46}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \cdot b \leq -2 \cdot 10^{-43}:\\
\;\;\;\;c + x \cdot y\\
\mathbf{elif}\;a \cdot b \leq -1 \cdot 10^{-315}:\\
\;\;\;\;z \cdot \left(t \cdot 0.0625 + \frac{x \cdot y}{z}\right)\\
\mathbf{elif}\;a \cdot b \leq 2 \cdot 10^{+127}:\\
\;\;\;\;c + t \cdot \left(z \cdot 0.0625\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (*.f64 a b) < -4e46 or 1.99999999999999991e127 < (*.f64 a b) Initial program 94.6%
Taylor expanded in z around 0 86.0%
Taylor expanded in c around 0 78.4%
if -4e46 < (*.f64 a b) < -2.00000000000000015e-43Initial program 100.0%
Taylor expanded in x around inf 79.2%
if -2.00000000000000015e-43 < (*.f64 a b) < -9.999999985e-316Initial program 98.0%
Taylor expanded in z around inf 90.6%
Taylor expanded in a around 0 90.6%
Taylor expanded in c around 0 71.6%
if -9.999999985e-316 < (*.f64 a b) < 1.99999999999999991e127Initial program 100.0%
Taylor expanded in z around inf 68.5%
associate-*r*68.5%
*-commutative68.5%
associate-*r*68.5%
Simplified68.5%
Final simplification73.5%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (+ c (* t (* z 0.0625)))) (t_2 (+ c (* x y))))
(if (<= (* x y) -1.66e+176)
t_2
(if (<= (* x y) -2.3e-43)
t_1
(if (<= (* x y) -5.8e-235)
(+ c (* a (* b -0.25)))
(if (<= (* x y) 250.0) t_1 t_2))))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = c + (t * (z * 0.0625));
double t_2 = c + (x * y);
double tmp;
if ((x * y) <= -1.66e+176) {
tmp = t_2;
} else if ((x * y) <= -2.3e-43) {
tmp = t_1;
} else if ((x * y) <= -5.8e-235) {
tmp = c + (a * (b * -0.25));
} else if ((x * y) <= 250.0) {
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 + (t * (z * 0.0625d0))
t_2 = c + (x * y)
if ((x * y) <= (-1.66d+176)) then
tmp = t_2
else if ((x * y) <= (-2.3d-43)) then
tmp = t_1
else if ((x * y) <= (-5.8d-235)) then
tmp = c + (a * (b * (-0.25d0)))
else if ((x * y) <= 250.0d0) 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 + (t * (z * 0.0625));
double t_2 = c + (x * y);
double tmp;
if ((x * y) <= -1.66e+176) {
tmp = t_2;
} else if ((x * y) <= -2.3e-43) {
tmp = t_1;
} else if ((x * y) <= -5.8e-235) {
tmp = c + (a * (b * -0.25));
} else if ((x * y) <= 250.0) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b, c): t_1 = c + (t * (z * 0.0625)) t_2 = c + (x * y) tmp = 0 if (x * y) <= -1.66e+176: tmp = t_2 elif (x * y) <= -2.3e-43: tmp = t_1 elif (x * y) <= -5.8e-235: tmp = c + (a * (b * -0.25)) elif (x * y) <= 250.0: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t, a, b, c) t_1 = Float64(c + Float64(t * Float64(z * 0.0625))) t_2 = Float64(c + Float64(x * y)) tmp = 0.0 if (Float64(x * y) <= -1.66e+176) tmp = t_2; elseif (Float64(x * y) <= -2.3e-43) tmp = t_1; elseif (Float64(x * y) <= -5.8e-235) tmp = Float64(c + Float64(a * Float64(b * -0.25))); elseif (Float64(x * y) <= 250.0) 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 + (t * (z * 0.0625)); t_2 = c + (x * y); tmp = 0.0; if ((x * y) <= -1.66e+176) tmp = t_2; elseif ((x * y) <= -2.3e-43) tmp = t_1; elseif ((x * y) <= -5.8e-235) tmp = c + (a * (b * -0.25)); elseif ((x * y) <= 250.0) 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[(t * N[(z * 0.0625), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(c + N[(x * y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x * y), $MachinePrecision], -1.66e+176], t$95$2, If[LessEqual[N[(x * y), $MachinePrecision], -2.3e-43], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], -5.8e-235], N[(c + N[(a * N[(b * -0.25), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 250.0], t$95$1, t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := c + t \cdot \left(z \cdot 0.0625\right)\\
t_2 := c + x \cdot y\\
\mathbf{if}\;x \cdot y \leq -1.66 \cdot 10^{+176}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;x \cdot y \leq -2.3 \cdot 10^{-43}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \cdot y \leq -5.8 \cdot 10^{-235}:\\
\;\;\;\;c + a \cdot \left(b \cdot -0.25\right)\\
\mathbf{elif}\;x \cdot y \leq 250:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if (*.f64 x y) < -1.6600000000000001e176 or 250 < (*.f64 x y) Initial program 94.7%
Taylor expanded in x around inf 76.0%
if -1.6600000000000001e176 < (*.f64 x y) < -2.2999999999999999e-43 or -5.80000000000000018e-235 < (*.f64 x y) < 250Initial program 99.2%
Taylor expanded in z around inf 67.2%
associate-*r*67.2%
*-commutative67.2%
associate-*r*67.2%
Simplified67.2%
if -2.2999999999999999e-43 < (*.f64 x y) < -5.80000000000000018e-235Initial program 100.0%
Taylor expanded in a around inf 73.5%
*-commutative73.5%
associate-*r*73.5%
Simplified73.5%
Final simplification71.3%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (* t (* z 0.0625))))
(if (<= (* x y) -1.5e+176)
(* x y)
(if (<= (* x y) -3.35e-46)
t_1
(if (<= (* x y) -2.6e-235)
(* a (* b -0.25))
(if (<= (* x y) 0.5) t_1 (* x y)))))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = t * (z * 0.0625);
double tmp;
if ((x * y) <= -1.5e+176) {
tmp = x * y;
} else if ((x * y) <= -3.35e-46) {
tmp = t_1;
} else if ((x * y) <= -2.6e-235) {
tmp = a * (b * -0.25);
} else if ((x * y) <= 0.5) {
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 = t * (z * 0.0625d0)
if ((x * y) <= (-1.5d+176)) then
tmp = x * y
else if ((x * y) <= (-3.35d-46)) then
tmp = t_1
else if ((x * y) <= (-2.6d-235)) then
tmp = a * (b * (-0.25d0))
else if ((x * y) <= 0.5d0) 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 = t * (z * 0.0625);
double tmp;
if ((x * y) <= -1.5e+176) {
tmp = x * y;
} else if ((x * y) <= -3.35e-46) {
tmp = t_1;
} else if ((x * y) <= -2.6e-235) {
tmp = a * (b * -0.25);
} else if ((x * y) <= 0.5) {
tmp = t_1;
} else {
tmp = x * y;
}
return tmp;
}
def code(x, y, z, t, a, b, c): t_1 = t * (z * 0.0625) tmp = 0 if (x * y) <= -1.5e+176: tmp = x * y elif (x * y) <= -3.35e-46: tmp = t_1 elif (x * y) <= -2.6e-235: tmp = a * (b * -0.25) elif (x * y) <= 0.5: tmp = t_1 else: tmp = x * y return tmp
function code(x, y, z, t, a, b, c) t_1 = Float64(t * Float64(z * 0.0625)) tmp = 0.0 if (Float64(x * y) <= -1.5e+176) tmp = Float64(x * y); elseif (Float64(x * y) <= -3.35e-46) tmp = t_1; elseif (Float64(x * y) <= -2.6e-235) tmp = Float64(a * Float64(b * -0.25)); elseif (Float64(x * y) <= 0.5) 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 = t * (z * 0.0625); tmp = 0.0; if ((x * y) <= -1.5e+176) tmp = x * y; elseif ((x * y) <= -3.35e-46) tmp = t_1; elseif ((x * y) <= -2.6e-235) tmp = a * (b * -0.25); elseif ((x * y) <= 0.5) 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[(t * N[(z * 0.0625), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x * y), $MachinePrecision], -1.5e+176], N[(x * y), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], -3.35e-46], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], -2.6e-235], N[(a * N[(b * -0.25), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 0.5], t$95$1, N[(x * y), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := t \cdot \left(z \cdot 0.0625\right)\\
\mathbf{if}\;x \cdot y \leq -1.5 \cdot 10^{+176}:\\
\;\;\;\;x \cdot y\\
\mathbf{elif}\;x \cdot y \leq -3.35 \cdot 10^{-46}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \cdot y \leq -2.6 \cdot 10^{-235}:\\
\;\;\;\;a \cdot \left(b \cdot -0.25\right)\\
\mathbf{elif}\;x \cdot y \leq 0.5:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;x \cdot y\\
\end{array}
\end{array}
if (*.f64 x y) < -1.5e176 or 0.5 < (*.f64 x y) Initial program 94.7%
Taylor expanded in z around 0 89.2%
Taylor expanded in x around inf 66.0%
if -1.5e176 < (*.f64 x y) < -3.35e-46 or -2.6e-235 < (*.f64 x y) < 0.5Initial program 99.2%
Taylor expanded in z around inf 67.2%
associate-*r*67.2%
*-commutative67.2%
associate-*r*67.2%
Simplified67.2%
Taylor expanded in t around inf 40.0%
associate-*r*40.0%
*-commutative40.0%
associate-*r*40.0%
Simplified40.0%
if -3.35e-46 < (*.f64 x y) < -2.6e-235Initial program 100.0%
Taylor expanded in z around 0 79.1%
Taylor expanded in a around inf 48.5%
*-commutative48.5%
associate-*r*48.5%
Simplified48.5%
Final simplification50.7%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (- (* x y) (* (* a b) 0.25))))
(if (<= (* a b) -4e+46)
t_1
(if (<= (* a b) 1e-267)
(+ c (* x y))
(if (<= (* a b) 2e+127) (+ c (* t (* z 0.0625))) t_1)))))
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 ((a * b) <= -4e+46) {
tmp = t_1;
} else if ((a * b) <= 1e-267) {
tmp = c + (x * y);
} else if ((a * b) <= 2e+127) {
tmp = c + (t * (z * 0.0625));
} 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 = (x * y) - ((a * b) * 0.25d0)
if ((a * b) <= (-4d+46)) then
tmp = t_1
else if ((a * b) <= 1d-267) then
tmp = c + (x * y)
else if ((a * b) <= 2d+127) then
tmp = c + (t * (z * 0.0625d0))
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 = (x * y) - ((a * b) * 0.25);
double tmp;
if ((a * b) <= -4e+46) {
tmp = t_1;
} else if ((a * b) <= 1e-267) {
tmp = c + (x * y);
} else if ((a * b) <= 2e+127) {
tmp = c + (t * (z * 0.0625));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c): t_1 = (x * y) - ((a * b) * 0.25) tmp = 0 if (a * b) <= -4e+46: tmp = t_1 elif (a * b) <= 1e-267: tmp = c + (x * y) elif (a * b) <= 2e+127: tmp = c + (t * (z * 0.0625)) else: tmp = t_1 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(a * b) <= -4e+46) tmp = t_1; elseif (Float64(a * b) <= 1e-267) tmp = Float64(c + Float64(x * y)); elseif (Float64(a * b) <= 2e+127) tmp = Float64(c + Float64(t * Float64(z * 0.0625))); else tmp = t_1; 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 ((a * b) <= -4e+46) tmp = t_1; elseif ((a * b) <= 1e-267) tmp = c + (x * y); elseif ((a * b) <= 2e+127) tmp = c + (t * (z * 0.0625)); else tmp = t_1; 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[(a * b), $MachinePrecision], -4e+46], t$95$1, If[LessEqual[N[(a * b), $MachinePrecision], 1e-267], N[(c + N[(x * y), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(a * b), $MachinePrecision], 2e+127], N[(c + N[(t * N[(z * 0.0625), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot y - \left(a \cdot b\right) \cdot 0.25\\
\mathbf{if}\;a \cdot b \leq -4 \cdot 10^{+46}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \cdot b \leq 10^{-267}:\\
\;\;\;\;c + x \cdot y\\
\mathbf{elif}\;a \cdot b \leq 2 \cdot 10^{+127}:\\
\;\;\;\;c + t \cdot \left(z \cdot 0.0625\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (*.f64 a b) < -4e46 or 1.99999999999999991e127 < (*.f64 a b) Initial program 94.6%
Taylor expanded in z around 0 86.0%
Taylor expanded in c around 0 78.4%
if -4e46 < (*.f64 a b) < 9.9999999999999998e-268Initial program 98.9%
Taylor expanded in x around inf 69.0%
if 9.9999999999999998e-268 < (*.f64 a b) < 1.99999999999999991e127Initial program 100.0%
Taylor expanded in z around inf 68.2%
associate-*r*68.2%
*-commutative68.2%
associate-*r*68.2%
Simplified68.2%
Final simplification72.2%
(FPCore (x y z t a b c) :precision binary64 (if (or (<= (* a b) -2e+113) (not (<= (* a b) 2e+127))) (- (+ c (* x y)) (* (* a b) 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) <= -2e+113) || !((a * b) <= 2e+127)) {
tmp = (c + (x * y)) - ((a * b) * 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) <= (-2d+113)) .or. (.not. ((a * b) <= 2d+127))) then
tmp = (c + (x * y)) - ((a * b) * 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) <= -2e+113) || !((a * b) <= 2e+127)) {
tmp = (c + (x * y)) - ((a * b) * 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) <= -2e+113) or not ((a * b) <= 2e+127): tmp = (c + (x * y)) - ((a * b) * 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) <= -2e+113) || !(Float64(a * b) <= 2e+127)) tmp = Float64(Float64(c + Float64(x * y)) - Float64(Float64(a * b) * 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) <= -2e+113) || ~(((a * b) <= 2e+127))) tmp = (c + (x * y)) - ((a * b) * 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], -2e+113], N[Not[LessEqual[N[(a * b), $MachinePrecision], 2e+127]], $MachinePrecision]], N[(N[(c + N[(x * y), $MachinePrecision]), $MachinePrecision] - N[(N[(a * b), $MachinePrecision] * 0.25), $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 -2 \cdot 10^{+113} \lor \neg \left(a \cdot b \leq 2 \cdot 10^{+127}\right):\\
\;\;\;\;\left(c + x \cdot y\right) - \left(a \cdot b\right) \cdot 0.25\\
\mathbf{else}:\\
\;\;\;\;c + \left(x \cdot y + 0.0625 \cdot \left(z \cdot t\right)\right)\\
\end{array}
\end{array}
if (*.f64 a b) < -2e113 or 1.99999999999999991e127 < (*.f64 a b) Initial program 94.1%
Taylor expanded in z around 0 89.8%
if -2e113 < (*.f64 a b) < 1.99999999999999991e127Initial program 99.4%
Taylor expanded in a around 0 94.1%
Final simplification92.6%
(FPCore (x y z t a b c) :precision binary64 (if (or (<= (* a b) -5e+131) (not (<= (* a b) 2e+127))) (- (* x y) (* (* a b) 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+131) || !((a * b) <= 2e+127)) {
tmp = (x * y) - ((a * b) * 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+131)) .or. (.not. ((a * b) <= 2d+127))) then
tmp = (x * y) - ((a * b) * 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+131) || !((a * b) <= 2e+127)) {
tmp = (x * y) - ((a * b) * 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+131) or not ((a * b) <= 2e+127): tmp = (x * y) - ((a * b) * 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+131) || !(Float64(a * b) <= 2e+127)) tmp = Float64(Float64(x * y) - Float64(Float64(a * b) * 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+131) || ~(((a * b) <= 2e+127))) tmp = (x * y) - ((a * b) * 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+131], N[Not[LessEqual[N[(a * b), $MachinePrecision], 2e+127]], $MachinePrecision]], N[(N[(x * y), $MachinePrecision] - N[(N[(a * b), $MachinePrecision] * 0.25), $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^{+131} \lor \neg \left(a \cdot b \leq 2 \cdot 10^{+127}\right):\\
\;\;\;\;x \cdot y - \left(a \cdot b\right) \cdot 0.25\\
\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.99999999999999995e131 or 1.99999999999999991e127 < (*.f64 a b) Initial program 94.0%
Taylor expanded in z around 0 89.5%
Taylor expanded in c around 0 82.1%
if -4.99999999999999995e131 < (*.f64 a b) < 1.99999999999999991e127Initial program 99.4%
Taylor expanded in a around 0 93.6%
Final simplification89.9%
(FPCore (x y z t a b c)
:precision binary64
(if (<= (* x y) -5.2e+46)
(* x y)
(if (<= (* x y) 1.9e-187)
(* a (* b -0.25))
(if (<= (* x y) 9.8e-37) c (* x y)))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if ((x * y) <= -5.2e+46) {
tmp = x * y;
} else if ((x * y) <= 1.9e-187) {
tmp = a * (b * -0.25);
} else if ((x * y) <= 9.8e-37) {
tmp = c;
} 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) :: tmp
if ((x * y) <= (-5.2d+46)) then
tmp = x * y
else if ((x * y) <= 1.9d-187) then
tmp = a * (b * (-0.25d0))
else if ((x * y) <= 9.8d-37) then
tmp = c
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 tmp;
if ((x * y) <= -5.2e+46) {
tmp = x * y;
} else if ((x * y) <= 1.9e-187) {
tmp = a * (b * -0.25);
} else if ((x * y) <= 9.8e-37) {
tmp = c;
} else {
tmp = x * y;
}
return tmp;
}
def code(x, y, z, t, a, b, c): tmp = 0 if (x * y) <= -5.2e+46: tmp = x * y elif (x * y) <= 1.9e-187: tmp = a * (b * -0.25) elif (x * y) <= 9.8e-37: tmp = c else: tmp = x * y return tmp
function code(x, y, z, t, a, b, c) tmp = 0.0 if (Float64(x * y) <= -5.2e+46) tmp = Float64(x * y); elseif (Float64(x * y) <= 1.9e-187) tmp = Float64(a * Float64(b * -0.25)); elseif (Float64(x * y) <= 9.8e-37) tmp = c; else tmp = Float64(x * y); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) tmp = 0.0; if ((x * y) <= -5.2e+46) tmp = x * y; elseif ((x * y) <= 1.9e-187) tmp = a * (b * -0.25); elseif ((x * y) <= 9.8e-37) tmp = c; else tmp = x * y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := If[LessEqual[N[(x * y), $MachinePrecision], -5.2e+46], N[(x * y), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 1.9e-187], N[(a * N[(b * -0.25), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 9.8e-37], c, N[(x * y), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \cdot y \leq -5.2 \cdot 10^{+46}:\\
\;\;\;\;x \cdot y\\
\mathbf{elif}\;x \cdot y \leq 1.9 \cdot 10^{-187}:\\
\;\;\;\;a \cdot \left(b \cdot -0.25\right)\\
\mathbf{elif}\;x \cdot y \leq 9.8 \cdot 10^{-37}:\\
\;\;\;\;c\\
\mathbf{else}:\\
\;\;\;\;x \cdot y\\
\end{array}
\end{array}
if (*.f64 x y) < -5.20000000000000027e46 or 9.80000000000000036e-37 < (*.f64 x y) Initial program 95.3%
Taylor expanded in z around 0 80.8%
Taylor expanded in x around inf 54.1%
if -5.20000000000000027e46 < (*.f64 x y) < 1.90000000000000013e-187Initial program 100.0%
Taylor expanded in z around 0 65.7%
Taylor expanded in a around inf 38.6%
*-commutative38.6%
associate-*r*38.6%
Simplified38.6%
if 1.90000000000000013e-187 < (*.f64 x y) < 9.80000000000000036e-37Initial program 100.0%
Taylor expanded in c around inf 47.8%
(FPCore (x y z t a b c) :precision binary64 (if (or (<= (* x y) -2.55e+165) (not (<= (* x y) 6.4e-17))) (+ c (* x y)) (+ c (* a (* b -0.25)))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if (((x * y) <= -2.55e+165) || !((x * y) <= 6.4e-17)) {
tmp = c + (x * y);
} else {
tmp = c + (a * (b * -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) <= (-2.55d+165)) .or. (.not. ((x * y) <= 6.4d-17))) then
tmp = c + (x * y)
else
tmp = c + (a * (b * (-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) <= -2.55e+165) || !((x * y) <= 6.4e-17)) {
tmp = c + (x * y);
} else {
tmp = c + (a * (b * -0.25));
}
return tmp;
}
def code(x, y, z, t, a, b, c): tmp = 0 if ((x * y) <= -2.55e+165) or not ((x * y) <= 6.4e-17): tmp = c + (x * y) else: tmp = c + (a * (b * -0.25)) return tmp
function code(x, y, z, t, a, b, c) tmp = 0.0 if ((Float64(x * y) <= -2.55e+165) || !(Float64(x * y) <= 6.4e-17)) tmp = Float64(c + Float64(x * y)); else tmp = Float64(c + Float64(a * Float64(b * -0.25))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) tmp = 0.0; if (((x * y) <= -2.55e+165) || ~(((x * y) <= 6.4e-17))) tmp = c + (x * y); else tmp = c + (a * (b * -0.25)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := If[Or[LessEqual[N[(x * y), $MachinePrecision], -2.55e+165], N[Not[LessEqual[N[(x * y), $MachinePrecision], 6.4e-17]], $MachinePrecision]], N[(c + N[(x * y), $MachinePrecision]), $MachinePrecision], N[(c + N[(a * N[(b * -0.25), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \cdot y \leq -2.55 \cdot 10^{+165} \lor \neg \left(x \cdot y \leq 6.4 \cdot 10^{-17}\right):\\
\;\;\;\;c + x \cdot y\\
\mathbf{else}:\\
\;\;\;\;c + a \cdot \left(b \cdot -0.25\right)\\
\end{array}
\end{array}
if (*.f64 x y) < -2.5500000000000002e165 or 6.4000000000000005e-17 < (*.f64 x y) Initial program 94.9%
Taylor expanded in x around inf 73.3%
if -2.5500000000000002e165 < (*.f64 x y) < 6.4000000000000005e-17Initial program 99.3%
Taylor expanded in a around inf 60.1%
*-commutative60.1%
associate-*r*60.1%
Simplified60.1%
Final simplification65.2%
(FPCore (x y z t a b c) :precision binary64 (if (or (<= (* x y) -3.8e+59) (not (<= (* x y) 2.85e-36))) (* 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.8e+59) || !((x * y) <= 2.85e-36)) {
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.8d+59)) .or. (.not. ((x * y) <= 2.85d-36))) 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.8e+59) || !((x * y) <= 2.85e-36)) {
tmp = x * y;
} else {
tmp = c;
}
return tmp;
}
def code(x, y, z, t, a, b, c): tmp = 0 if ((x * y) <= -3.8e+59) or not ((x * y) <= 2.85e-36): 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.8e+59) || !(Float64(x * y) <= 2.85e-36)) 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.8e+59) || ~(((x * y) <= 2.85e-36))) 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.8e+59], N[Not[LessEqual[N[(x * y), $MachinePrecision], 2.85e-36]], $MachinePrecision]], N[(x * y), $MachinePrecision], c]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \cdot y \leq -3.8 \cdot 10^{+59} \lor \neg \left(x \cdot y \leq 2.85 \cdot 10^{-36}\right):\\
\;\;\;\;x \cdot y\\
\mathbf{else}:\\
\;\;\;\;c\\
\end{array}
\end{array}
if (*.f64 x y) < -3.8000000000000001e59 or 2.8499999999999999e-36 < (*.f64 x y) Initial program 95.2%
Taylor expanded in z around 0 80.3%
Taylor expanded in x around inf 54.6%
if -3.8000000000000001e59 < (*.f64 x y) < 2.8499999999999999e-36Initial program 100.0%
Taylor expanded in c around inf 31.9%
Final simplification43.0%
(FPCore (x y z t a b c) :precision binary64 (+ c (- (+ (* 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 + (((x * y) + ((z * t) / 16.0)) - ((a * b) / 4.0));
}
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 + (((x * y) + ((z * t) / 16.0d0)) - ((a * b) / 4.0d0))
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
return c + (((x * y) + ((z * t) / 16.0)) - ((a * b) / 4.0));
}
def code(x, y, z, t, a, b, c): return c + (((x * y) + ((z * t) / 16.0)) - ((a * b) / 4.0))
function code(x, y, z, t, a, b, c) return Float64(c + Float64(Float64(Float64(x * y) + Float64(Float64(z * t) / 16.0)) - Float64(Float64(a * b) / 4.0))) end
function tmp = code(x, y, z, t, a, b, c) tmp = c + (((x * y) + ((z * t) / 16.0)) - ((a * b) / 4.0)); end
code[x_, y_, z_, t_, a_, b_, c_] := N[(c + N[(N[(N[(x * y), $MachinePrecision] + N[(N[(z * t), $MachinePrecision] / 16.0), $MachinePrecision]), $MachinePrecision] - N[(N[(a * b), $MachinePrecision] / 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
c + \left(\left(x \cdot y + \frac{z \cdot t}{16}\right) - \frac{a \cdot b}{4}\right)
\end{array}
Initial program 97.6%
Final simplification97.6%
(FPCore (x y z t a b c) :precision binary64 (if (or (<= a -5.5e+172) (not (<= a 5.6e-18))) (* a (* b -0.25)) (+ c (* x y))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if ((a <= -5.5e+172) || !(a <= 5.6e-18)) {
tmp = a * (b * -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 ((a <= (-5.5d+172)) .or. (.not. (a <= 5.6d-18))) then
tmp = a * (b * (-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 ((a <= -5.5e+172) || !(a <= 5.6e-18)) {
tmp = a * (b * -0.25);
} else {
tmp = c + (x * y);
}
return tmp;
}
def code(x, y, z, t, a, b, c): tmp = 0 if (a <= -5.5e+172) or not (a <= 5.6e-18): tmp = a * (b * -0.25) else: tmp = c + (x * y) return tmp
function code(x, y, z, t, a, b, c) tmp = 0.0 if ((a <= -5.5e+172) || !(a <= 5.6e-18)) tmp = Float64(a * Float64(b * -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 ((a <= -5.5e+172) || ~((a <= 5.6e-18))) tmp = a * (b * -0.25); else tmp = c + (x * y); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := If[Or[LessEqual[a, -5.5e+172], N[Not[LessEqual[a, 5.6e-18]], $MachinePrecision]], N[(a * N[(b * -0.25), $MachinePrecision]), $MachinePrecision], N[(c + N[(x * y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -5.5 \cdot 10^{+172} \lor \neg \left(a \leq 5.6 \cdot 10^{-18}\right):\\
\;\;\;\;a \cdot \left(b \cdot -0.25\right)\\
\mathbf{else}:\\
\;\;\;\;c + x \cdot y\\
\end{array}
\end{array}
if a < -5.4999999999999999e172 or 5.60000000000000025e-18 < a Initial program 95.6%
Taylor expanded in z around 0 80.3%
Taylor expanded in a around inf 49.2%
*-commutative49.2%
associate-*r*49.2%
Simplified49.2%
if -5.4999999999999999e172 < a < 5.60000000000000025e-18Initial program 98.8%
Taylor expanded in x around inf 58.0%
Final simplification54.9%
(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 97.6%
Taylor expanded in c around inf 22.1%
herbie shell --seed 2024123
(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))