
(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 97.7%
associate--l+97.7%
fma-define98.1%
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.7%
associate-+l-97.7%
*-commutative97.7%
associate-+l-97.7%
fma-define98.1%
*-commutative98.1%
associate-/l*98.4%
associate-/l*98.4%
Simplified98.4%
Final simplification98.4%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (+ c (* a (* b -0.25)))))
(if (<= (* a b) -2e+109)
t_1
(if (<= (* a b) 1e-262)
(+ c (* x y))
(if (<= (* a b) 2e+143) (+ c (* z (* t 0.0625))) t_1)))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = c + (a * (b * -0.25));
double tmp;
if ((a * b) <= -2e+109) {
tmp = t_1;
} else if ((a * b) <= 1e-262) {
tmp = c + (x * y);
} else if ((a * b) <= 2e+143) {
tmp = c + (z * (t * 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 = c + (a * (b * (-0.25d0)))
if ((a * b) <= (-2d+109)) then
tmp = t_1
else if ((a * b) <= 1d-262) then
tmp = c + (x * y)
else if ((a * b) <= 2d+143) then
tmp = c + (z * (t * 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 = c + (a * (b * -0.25));
double tmp;
if ((a * b) <= -2e+109) {
tmp = t_1;
} else if ((a * b) <= 1e-262) {
tmp = c + (x * y);
} else if ((a * b) <= 2e+143) {
tmp = c + (z * (t * 0.0625));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c): t_1 = c + (a * (b * -0.25)) tmp = 0 if (a * b) <= -2e+109: tmp = t_1 elif (a * b) <= 1e-262: tmp = c + (x * y) elif (a * b) <= 2e+143: tmp = c + (z * (t * 0.0625)) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b, c) t_1 = Float64(c + Float64(a * Float64(b * -0.25))) tmp = 0.0 if (Float64(a * b) <= -2e+109) tmp = t_1; elseif (Float64(a * b) <= 1e-262) tmp = Float64(c + Float64(x * y)); elseif (Float64(a * b) <= 2e+143) tmp = Float64(c + Float64(z * Float64(t * 0.0625))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) t_1 = c + (a * (b * -0.25)); tmp = 0.0; if ((a * b) <= -2e+109) tmp = t_1; elseif ((a * b) <= 1e-262) tmp = c + (x * y); elseif ((a * b) <= 2e+143) tmp = c + (z * (t * 0.0625)); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(c + N[(a * N[(b * -0.25), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(a * b), $MachinePrecision], -2e+109], t$95$1, If[LessEqual[N[(a * b), $MachinePrecision], 1e-262], N[(c + N[(x * y), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(a * b), $MachinePrecision], 2e+143], N[(c + N[(z * N[(t * 0.0625), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := c + a \cdot \left(b \cdot -0.25\right)\\
\mathbf{if}\;a \cdot b \leq -2 \cdot 10^{+109}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \cdot b \leq 10^{-262}:\\
\;\;\;\;c + x \cdot y\\
\mathbf{elif}\;a \cdot b \leq 2 \cdot 10^{+143}:\\
\;\;\;\;c + z \cdot \left(t \cdot 0.0625\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (*.f64 a b) < -1.99999999999999996e109 or 2e143 < (*.f64 a b) Initial program 95.9%
associate--l+95.9%
fma-define95.9%
associate-/l*95.9%
fma-neg97.3%
distribute-neg-frac297.3%
metadata-eval97.3%
Simplified97.3%
Taylor expanded in a around inf 81.7%
*-commutative81.7%
associate-*r*81.7%
Simplified81.7%
if -1.99999999999999996e109 < (*.f64 a b) < 1.00000000000000001e-262Initial program 99.1%
Taylor expanded in a around 0 93.5%
Taylor expanded in t around 0 66.0%
+-commutative66.0%
Simplified66.0%
if 1.00000000000000001e-262 < (*.f64 a b) < 2e143Initial program 97.1%
Taylor expanded in a around 0 88.2%
Taylor expanded in x around inf 82.3%
associate-*r/82.3%
associate-*r*83.6%
*-commutative83.6%
*-commutative83.6%
*-commutative83.6%
Simplified83.6%
Taylor expanded in x around 0 66.5%
associate-*r*67.8%
*-commutative67.8%
Simplified67.8%
Final simplification71.0%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (* (* a b) 0.25)))
(if (<= (* x y) -1e+62)
(+ c (* x (+ y (/ (* z (* t 0.0625)) x))))
(if (<= (* x y) 2e+184)
(- (+ c (* 0.0625 (* z t))) t_1)
(- (+ 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 tmp;
if ((x * y) <= -1e+62) {
tmp = c + (x * (y + ((z * (t * 0.0625)) / x)));
} else if ((x * y) <= 2e+184) {
tmp = (c + (0.0625 * (z * t))) - t_1;
} 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) :: tmp
t_1 = (a * b) * 0.25d0
if ((x * y) <= (-1d+62)) then
tmp = c + (x * (y + ((z * (t * 0.0625d0)) / x)))
else if ((x * y) <= 2d+184) then
tmp = (c + (0.0625d0 * (z * t))) - t_1
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 tmp;
if ((x * y) <= -1e+62) {
tmp = c + (x * (y + ((z * (t * 0.0625)) / x)));
} else if ((x * y) <= 2e+184) {
tmp = (c + (0.0625 * (z * t))) - t_1;
} else {
tmp = (c + (x * y)) - t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c): t_1 = (a * b) * 0.25 tmp = 0 if (x * y) <= -1e+62: tmp = c + (x * (y + ((z * (t * 0.0625)) / x))) elif (x * y) <= 2e+184: tmp = (c + (0.0625 * (z * t))) - t_1 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) tmp = 0.0 if (Float64(x * y) <= -1e+62) tmp = Float64(c + Float64(x * Float64(y + Float64(Float64(z * Float64(t * 0.0625)) / x)))); elseif (Float64(x * y) <= 2e+184) tmp = Float64(Float64(c + Float64(0.0625 * Float64(z * t))) - t_1); 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; tmp = 0.0; if ((x * y) <= -1e+62) tmp = c + (x * (y + ((z * (t * 0.0625)) / x))); elseif ((x * y) <= 2e+184) tmp = (c + (0.0625 * (z * t))) - t_1; 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]}, If[LessEqual[N[(x * y), $MachinePrecision], -1e+62], N[(c + N[(x * N[(y + N[(N[(z * N[(t * 0.0625), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 2e+184], N[(N[(c + N[(0.0625 * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$1), $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\\
\mathbf{if}\;x \cdot y \leq -1 \cdot 10^{+62}:\\
\;\;\;\;c + x \cdot \left(y + \frac{z \cdot \left(t \cdot 0.0625\right)}{x}\right)\\
\mathbf{elif}\;x \cdot y \leq 2 \cdot 10^{+184}:\\
\;\;\;\;\left(c + 0.0625 \cdot \left(z \cdot t\right)\right) - t\_1\\
\mathbf{else}:\\
\;\;\;\;\left(c + x \cdot y\right) - t\_1\\
\end{array}
\end{array}
if (*.f64 x y) < -1.00000000000000004e62Initial program 97.0%
Taylor expanded in a around 0 89.3%
Taylor expanded in x around inf 89.4%
associate-*r/89.4%
associate-*r*90.7%
*-commutative90.7%
*-commutative90.7%
*-commutative90.7%
Simplified90.7%
if -1.00000000000000004e62 < (*.f64 x y) < 2.00000000000000003e184Initial program 98.7%
Taylor expanded in x around 0 93.9%
if 2.00000000000000003e184 < (*.f64 x y) Initial program 94.1%
Taylor expanded in z around 0 91.4%
Final simplification92.8%
(FPCore (x y z t a b c) :precision binary64 (if (or (<= (* a b) -4e+71) (not (<= (* a b) 2e+143))) (- (+ 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) <= -4e+71) || !((a * b) <= 2e+143)) {
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) <= (-4d+71)) .or. (.not. ((a * b) <= 2d+143))) 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) <= -4e+71) || !((a * b) <= 2e+143)) {
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) <= -4e+71) or not ((a * b) <= 2e+143): 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) <= -4e+71) || !(Float64(a * b) <= 2e+143)) 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) <= -4e+71) || ~(((a * b) <= 2e+143))) 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], -4e+71], N[Not[LessEqual[N[(a * b), $MachinePrecision], 2e+143]], $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 -4 \cdot 10^{+71} \lor \neg \left(a \cdot b \leq 2 \cdot 10^{+143}\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) < -4.0000000000000002e71 or 2e143 < (*.f64 a b) Initial program 96.3%
Taylor expanded in z around 0 87.5%
if -4.0000000000000002e71 < (*.f64 a b) < 2e143Initial program 98.4%
Taylor expanded in a around 0 92.6%
Final simplification90.9%
(FPCore (x y z t a b c)
:precision binary64
(if (<= (* a b) -5e+242)
(- (* x y) (* (* a b) 0.25))
(if (<= (* a b) 2e+143)
(+ c (+ (* x y) (* 0.0625 (* z t))))
(+ c (* a (* b -0.25))))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if ((a * b) <= -5e+242) {
tmp = (x * y) - ((a * b) * 0.25);
} else if ((a * b) <= 2e+143) {
tmp = c + ((x * y) + (0.0625 * (z * t)));
} 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 ((a * b) <= (-5d+242)) then
tmp = (x * y) - ((a * b) * 0.25d0)
else if ((a * b) <= 2d+143) then
tmp = c + ((x * y) + (0.0625d0 * (z * t)))
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 ((a * b) <= -5e+242) {
tmp = (x * y) - ((a * b) * 0.25);
} else if ((a * b) <= 2e+143) {
tmp = c + ((x * y) + (0.0625 * (z * t)));
} else {
tmp = c + (a * (b * -0.25));
}
return tmp;
}
def code(x, y, z, t, a, b, c): tmp = 0 if (a * b) <= -5e+242: tmp = (x * y) - ((a * b) * 0.25) elif (a * b) <= 2e+143: tmp = c + ((x * y) + (0.0625 * (z * t))) else: tmp = c + (a * (b * -0.25)) return tmp
function code(x, y, z, t, a, b, c) tmp = 0.0 if (Float64(a * b) <= -5e+242) tmp = Float64(Float64(x * y) - Float64(Float64(a * b) * 0.25)); elseif (Float64(a * b) <= 2e+143) tmp = Float64(c + Float64(Float64(x * y) + Float64(0.0625 * Float64(z * t)))); 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 ((a * b) <= -5e+242) tmp = (x * y) - ((a * b) * 0.25); elseif ((a * b) <= 2e+143) tmp = c + ((x * y) + (0.0625 * (z * t))); else tmp = c + (a * (b * -0.25)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := If[LessEqual[N[(a * b), $MachinePrecision], -5e+242], N[(N[(x * y), $MachinePrecision] - N[(N[(a * b), $MachinePrecision] * 0.25), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(a * b), $MachinePrecision], 2e+143], N[(c + N[(N[(x * y), $MachinePrecision] + N[(0.0625 * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(c + N[(a * N[(b * -0.25), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \cdot b \leq -5 \cdot 10^{+242}:\\
\;\;\;\;x \cdot y - \left(a \cdot b\right) \cdot 0.25\\
\mathbf{elif}\;a \cdot b \leq 2 \cdot 10^{+143}:\\
\;\;\;\;c + \left(x \cdot y + 0.0625 \cdot \left(z \cdot t\right)\right)\\
\mathbf{else}:\\
\;\;\;\;c + a \cdot \left(b \cdot -0.25\right)\\
\end{array}
\end{array}
if (*.f64 a b) < -5.0000000000000004e242Initial program 96.4%
Taylor expanded in z around 0 93.2%
Taylor expanded in c around 0 93.2%
if -5.0000000000000004e242 < (*.f64 a b) < 2e143Initial program 98.5%
Taylor expanded in a around 0 90.2%
if 2e143 < (*.f64 a b) Initial program 94.0%
associate--l+94.0%
fma-define94.0%
associate-/l*94.0%
fma-neg97.0%
distribute-neg-frac297.0%
metadata-eval97.0%
Simplified97.0%
Taylor expanded in a around inf 84.4%
*-commutative84.4%
associate-*r*84.4%
Simplified84.4%
Final simplification89.8%
(FPCore (x y z t a b c) :precision binary64 (if (or (<= (* x y) -1e+62) (not (<= (* x y) 2e+184))) (- (* x y) (* (* a b) 0.25)) (+ c (* z (* t 0.0625)))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if (((x * y) <= -1e+62) || !((x * y) <= 2e+184)) {
tmp = (x * y) - ((a * b) * 0.25);
} else {
tmp = c + (z * (t * 0.0625));
}
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) <= (-1d+62)) .or. (.not. ((x * y) <= 2d+184))) then
tmp = (x * y) - ((a * b) * 0.25d0)
else
tmp = c + (z * (t * 0.0625d0))
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) <= -1e+62) || !((x * y) <= 2e+184)) {
tmp = (x * y) - ((a * b) * 0.25);
} else {
tmp = c + (z * (t * 0.0625));
}
return tmp;
}
def code(x, y, z, t, a, b, c): tmp = 0 if ((x * y) <= -1e+62) or not ((x * y) <= 2e+184): tmp = (x * y) - ((a * b) * 0.25) else: tmp = c + (z * (t * 0.0625)) return tmp
function code(x, y, z, t, a, b, c) tmp = 0.0 if ((Float64(x * y) <= -1e+62) || !(Float64(x * y) <= 2e+184)) tmp = Float64(Float64(x * y) - Float64(Float64(a * b) * 0.25)); else tmp = Float64(c + Float64(z * Float64(t * 0.0625))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) tmp = 0.0; if (((x * y) <= -1e+62) || ~(((x * y) <= 2e+184))) tmp = (x * y) - ((a * b) * 0.25); else tmp = c + (z * (t * 0.0625)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := If[Or[LessEqual[N[(x * y), $MachinePrecision], -1e+62], N[Not[LessEqual[N[(x * y), $MachinePrecision], 2e+184]], $MachinePrecision]], N[(N[(x * y), $MachinePrecision] - N[(N[(a * b), $MachinePrecision] * 0.25), $MachinePrecision]), $MachinePrecision], N[(c + N[(z * N[(t * 0.0625), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \cdot y \leq -1 \cdot 10^{+62} \lor \neg \left(x \cdot y \leq 2 \cdot 10^{+184}\right):\\
\;\;\;\;x \cdot y - \left(a \cdot b\right) \cdot 0.25\\
\mathbf{else}:\\
\;\;\;\;c + z \cdot \left(t \cdot 0.0625\right)\\
\end{array}
\end{array}
if (*.f64 x y) < -1.00000000000000004e62 or 2.00000000000000003e184 < (*.f64 x y) Initial program 95.9%
Taylor expanded in z around 0 85.8%
Taylor expanded in c around 0 80.2%
if -1.00000000000000004e62 < (*.f64 x y) < 2.00000000000000003e184Initial program 98.7%
Taylor expanded in a around 0 68.8%
Taylor expanded in x around inf 59.0%
associate-*r/59.0%
associate-*r*59.0%
*-commutative59.0%
*-commutative59.0%
*-commutative59.0%
Simplified59.0%
Taylor expanded in x around 0 64.3%
associate-*r*64.3%
*-commutative64.3%
Simplified64.3%
Final simplification70.2%
(FPCore (x y z t a b c) :precision binary64 (if (or (<= (* x y) -1e+62) (not (<= (* x y) 2e+184))) (+ c (* x y)) (+ c (* z (* t 0.0625)))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if (((x * y) <= -1e+62) || !((x * y) <= 2e+184)) {
tmp = c + (x * y);
} else {
tmp = c + (z * (t * 0.0625));
}
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) <= (-1d+62)) .or. (.not. ((x * y) <= 2d+184))) then
tmp = c + (x * y)
else
tmp = c + (z * (t * 0.0625d0))
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) <= -1e+62) || !((x * y) <= 2e+184)) {
tmp = c + (x * y);
} else {
tmp = c + (z * (t * 0.0625));
}
return tmp;
}
def code(x, y, z, t, a, b, c): tmp = 0 if ((x * y) <= -1e+62) or not ((x * y) <= 2e+184): tmp = c + (x * y) else: tmp = c + (z * (t * 0.0625)) return tmp
function code(x, y, z, t, a, b, c) tmp = 0.0 if ((Float64(x * y) <= -1e+62) || !(Float64(x * y) <= 2e+184)) tmp = Float64(c + Float64(x * y)); else tmp = Float64(c + Float64(z * Float64(t * 0.0625))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) tmp = 0.0; if (((x * y) <= -1e+62) || ~(((x * y) <= 2e+184))) tmp = c + (x * y); else tmp = c + (z * (t * 0.0625)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := If[Or[LessEqual[N[(x * y), $MachinePrecision], -1e+62], N[Not[LessEqual[N[(x * y), $MachinePrecision], 2e+184]], $MachinePrecision]], N[(c + N[(x * y), $MachinePrecision]), $MachinePrecision], N[(c + N[(z * N[(t * 0.0625), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \cdot y \leq -1 \cdot 10^{+62} \lor \neg \left(x \cdot y \leq 2 \cdot 10^{+184}\right):\\
\;\;\;\;c + x \cdot y\\
\mathbf{else}:\\
\;\;\;\;c + z \cdot \left(t \cdot 0.0625\right)\\
\end{array}
\end{array}
if (*.f64 x y) < -1.00000000000000004e62 or 2.00000000000000003e184 < (*.f64 x y) Initial program 95.9%
Taylor expanded in a around 0 86.9%
Taylor expanded in t around 0 75.7%
+-commutative75.7%
Simplified75.7%
if -1.00000000000000004e62 < (*.f64 x y) < 2.00000000000000003e184Initial program 98.7%
Taylor expanded in a around 0 68.8%
Taylor expanded in x around inf 59.0%
associate-*r/59.0%
associate-*r*59.0%
*-commutative59.0%
*-commutative59.0%
*-commutative59.0%
Simplified59.0%
Taylor expanded in x around 0 64.3%
associate-*r*64.3%
*-commutative64.3%
Simplified64.3%
Final simplification68.5%
(FPCore (x y z t a b c) :precision binary64 (if (or (<= (* x y) -1e+62) (not (<= (* x y) 2e+184))) (+ c (* x y)) (+ c (* 0.0625 (* z t)))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if (((x * y) <= -1e+62) || !((x * y) <= 2e+184)) {
tmp = c + (x * y);
} else {
tmp = c + (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 (((x * y) <= (-1d+62)) .or. (.not. ((x * y) <= 2d+184))) then
tmp = c + (x * y)
else
tmp = c + (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 (((x * y) <= -1e+62) || !((x * y) <= 2e+184)) {
tmp = c + (x * y);
} else {
tmp = c + (0.0625 * (z * t));
}
return tmp;
}
def code(x, y, z, t, a, b, c): tmp = 0 if ((x * y) <= -1e+62) or not ((x * y) <= 2e+184): tmp = c + (x * y) else: tmp = c + (0.0625 * (z * t)) return tmp
function code(x, y, z, t, a, b, c) tmp = 0.0 if ((Float64(x * y) <= -1e+62) || !(Float64(x * y) <= 2e+184)) tmp = Float64(c + Float64(x * y)); else tmp = Float64(c + 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 (((x * y) <= -1e+62) || ~(((x * y) <= 2e+184))) tmp = c + (x * y); else tmp = c + (0.0625 * (z * t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := If[Or[LessEqual[N[(x * y), $MachinePrecision], -1e+62], N[Not[LessEqual[N[(x * y), $MachinePrecision], 2e+184]], $MachinePrecision]], N[(c + N[(x * y), $MachinePrecision]), $MachinePrecision], N[(c + N[(0.0625 * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \cdot y \leq -1 \cdot 10^{+62} \lor \neg \left(x \cdot y \leq 2 \cdot 10^{+184}\right):\\
\;\;\;\;c + x \cdot y\\
\mathbf{else}:\\
\;\;\;\;c + 0.0625 \cdot \left(z \cdot t\right)\\
\end{array}
\end{array}
if (*.f64 x y) < -1.00000000000000004e62 or 2.00000000000000003e184 < (*.f64 x y) Initial program 95.9%
Taylor expanded in a around 0 86.9%
Taylor expanded in t around 0 75.7%
+-commutative75.7%
Simplified75.7%
if -1.00000000000000004e62 < (*.f64 x y) < 2.00000000000000003e184Initial program 98.7%
Taylor expanded in a around 0 68.8%
Taylor expanded in x around 0 64.3%
Final simplification68.5%
(FPCore (x y z t a b c) :precision binary64 (if (or (<= (* x y) -1.62e+59) (not (<= (* x y) 2.45e+184))) (* x y) (* z (* t 0.0625))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if (((x * y) <= -1.62e+59) || !((x * y) <= 2.45e+184)) {
tmp = x * y;
} else {
tmp = z * (t * 0.0625);
}
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) <= (-1.62d+59)) .or. (.not. ((x * y) <= 2.45d+184))) then
tmp = x * y
else
tmp = z * (t * 0.0625d0)
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) <= -1.62e+59) || !((x * y) <= 2.45e+184)) {
tmp = x * y;
} else {
tmp = z * (t * 0.0625);
}
return tmp;
}
def code(x, y, z, t, a, b, c): tmp = 0 if ((x * y) <= -1.62e+59) or not ((x * y) <= 2.45e+184): tmp = x * y else: tmp = z * (t * 0.0625) return tmp
function code(x, y, z, t, a, b, c) tmp = 0.0 if ((Float64(x * y) <= -1.62e+59) || !(Float64(x * y) <= 2.45e+184)) tmp = Float64(x * y); else tmp = Float64(z * Float64(t * 0.0625)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) tmp = 0.0; if (((x * y) <= -1.62e+59) || ~(((x * y) <= 2.45e+184))) tmp = x * y; else tmp = z * (t * 0.0625); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := If[Or[LessEqual[N[(x * y), $MachinePrecision], -1.62e+59], N[Not[LessEqual[N[(x * y), $MachinePrecision], 2.45e+184]], $MachinePrecision]], N[(x * y), $MachinePrecision], N[(z * N[(t * 0.0625), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \cdot y \leq -1.62 \cdot 10^{+59} \lor \neg \left(x \cdot y \leq 2.45 \cdot 10^{+184}\right):\\
\;\;\;\;x \cdot y\\
\mathbf{else}:\\
\;\;\;\;z \cdot \left(t \cdot 0.0625\right)\\
\end{array}
\end{array}
if (*.f64 x y) < -1.6200000000000001e59 or 2.45000000000000015e184 < (*.f64 x y) Initial program 96.0%
Taylor expanded in a around 0 87.0%
Taylor expanded in t around 0 76.0%
+-commutative76.0%
Simplified76.0%
Taylor expanded in x around inf 69.3%
if -1.6200000000000001e59 < (*.f64 x y) < 2.45000000000000015e184Initial program 98.7%
Taylor expanded in x around 0 93.8%
Taylor expanded in z around inf 83.9%
associate--l+83.9%
associate-*r/83.9%
div-sub84.0%
*-commutative84.0%
cancel-sign-sub-inv84.0%
distribute-lft-neg-in84.0%
distribute-rgt-neg-in84.0%
metadata-eval84.0%
associate-*r*84.0%
Simplified84.0%
Taylor expanded in t around inf 37.2%
Final simplification49.2%
(FPCore (x y z t a b c) :precision binary64 (if (or (<= (* x y) -1.08e+60) (not (<= (* x y) 1.9e+146))) (* 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) <= -1.08e+60) || !((x * y) <= 1.9e+146)) {
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) <= (-1.08d+60)) .or. (.not. ((x * y) <= 1.9d+146))) 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) <= -1.08e+60) || !((x * y) <= 1.9e+146)) {
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) <= -1.08e+60) or not ((x * y) <= 1.9e+146): 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) <= -1.08e+60) || !(Float64(x * y) <= 1.9e+146)) 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) <= -1.08e+60) || ~(((x * y) <= 1.9e+146))) 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], -1.08e+60], N[Not[LessEqual[N[(x * y), $MachinePrecision], 1.9e+146]], $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 -1.08 \cdot 10^{+60} \lor \neg \left(x \cdot y \leq 1.9 \cdot 10^{+146}\right):\\
\;\;\;\;x \cdot y\\
\mathbf{else}:\\
\;\;\;\;b \cdot \left(a \cdot -0.25\right)\\
\end{array}
\end{array}
if (*.f64 x y) < -1.08e60 or 1.8999999999999999e146 < (*.f64 x y) Initial program 96.1%
Taylor expanded in a around 0 87.6%
Taylor expanded in t around 0 73.0%
+-commutative73.0%
Simplified73.0%
Taylor expanded in x around inf 67.6%
if -1.08e60 < (*.f64 x y) < 1.8999999999999999e146Initial program 98.7%
Taylor expanded in x around 0 94.3%
Taylor expanded in t around 0 61.7%
Taylor expanded in c around 0 33.4%
*-commutative33.4%
*-commutative33.4%
associate-*r*33.4%
Simplified33.4%
Final simplification46.8%
(FPCore (x y z t a b c) :precision binary64 (if (or (<= (* x y) -2.7e+61) (not (<= (* x y) 4.4e+138))) (* x y) c))
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if (((x * y) <= -2.7e+61) || !((x * y) <= 4.4e+138)) {
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) <= (-2.7d+61)) .or. (.not. ((x * y) <= 4.4d+138))) 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) <= -2.7e+61) || !((x * y) <= 4.4e+138)) {
tmp = x * y;
} else {
tmp = c;
}
return tmp;
}
def code(x, y, z, t, a, b, c): tmp = 0 if ((x * y) <= -2.7e+61) or not ((x * y) <= 4.4e+138): tmp = x * y else: tmp = c return tmp
function code(x, y, z, t, a, b, c) tmp = 0.0 if ((Float64(x * y) <= -2.7e+61) || !(Float64(x * y) <= 4.4e+138)) 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) <= -2.7e+61) || ~(((x * y) <= 4.4e+138))) 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], -2.7e+61], N[Not[LessEqual[N[(x * y), $MachinePrecision], 4.4e+138]], $MachinePrecision]], N[(x * y), $MachinePrecision], c]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \cdot y \leq -2.7 \cdot 10^{+61} \lor \neg \left(x \cdot y \leq 4.4 \cdot 10^{+138}\right):\\
\;\;\;\;x \cdot y\\
\mathbf{else}:\\
\;\;\;\;c\\
\end{array}
\end{array}
if (*.f64 x y) < -2.7000000000000002e61 or 4.4000000000000001e138 < (*.f64 x y) Initial program 96.1%
Taylor expanded in a around 0 87.6%
Taylor expanded in t around 0 73.0%
+-commutative73.0%
Simplified73.0%
Taylor expanded in x around inf 67.6%
if -2.7000000000000002e61 < (*.f64 x y) < 4.4000000000000001e138Initial program 98.7%
Taylor expanded in c around inf 29.9%
Final simplification44.7%
(FPCore (x y z t a b c) :precision binary64 (+ c (- (+ (* x y) (* z (* t 0.0625))) (* 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 * 0.0625))) - (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 * 0.0625d0))) - (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 * 0.0625))) - (a * (b / 4.0)));
}
def code(x, y, z, t, a, b, c): return c + (((x * y) + (z * (t * 0.0625))) - (a * (b / 4.0)))
function code(x, y, z, t, a, b, c) return Float64(c + Float64(Float64(Float64(x * y) + Float64(z * Float64(t * 0.0625))) - Float64(a * Float64(b / 4.0)))) end
function tmp = code(x, y, z, t, a, b, c) tmp = c + (((x * y) + (z * (t * 0.0625))) - (a * (b / 4.0))); end
code[x_, y_, z_, t_, a_, b_, c_] := N[(c + N[(N[(N[(x * y), $MachinePrecision] + N[(z * N[(t * 0.0625), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(a * N[(b / 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
c + \left(\left(x \cdot y + z \cdot \left(t \cdot 0.0625\right)\right) - a \cdot \frac{b}{4}\right)
\end{array}
Initial program 97.7%
associate-+l-97.7%
*-commutative97.7%
associate-+l-97.7%
fma-define98.1%
*-commutative98.1%
associate-/l*98.4%
associate-/l*98.4%
Simplified98.4%
fma-undefine98.0%
associate-*r/97.7%
+-commutative97.7%
associate-*r/98.0%
div-inv98.0%
metadata-eval98.0%
Applied egg-rr98.0%
Final simplification98.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.7%
Final simplification97.7%
(FPCore (x y z t a b c) :precision binary64 (if (or (<= z -5.7e+181) (not (<= z 2e-55))) (* z (* t 0.0625)) (+ c (* x y))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if ((z <= -5.7e+181) || !(z <= 2e-55)) {
tmp = z * (t * 0.0625);
} 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 ((z <= (-5.7d+181)) .or. (.not. (z <= 2d-55))) then
tmp = z * (t * 0.0625d0)
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 ((z <= -5.7e+181) || !(z <= 2e-55)) {
tmp = z * (t * 0.0625);
} else {
tmp = c + (x * y);
}
return tmp;
}
def code(x, y, z, t, a, b, c): tmp = 0 if (z <= -5.7e+181) or not (z <= 2e-55): tmp = z * (t * 0.0625) else: tmp = c + (x * y) return tmp
function code(x, y, z, t, a, b, c) tmp = 0.0 if ((z <= -5.7e+181) || !(z <= 2e-55)) tmp = Float64(z * Float64(t * 0.0625)); 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 ((z <= -5.7e+181) || ~((z <= 2e-55))) tmp = z * (t * 0.0625); else tmp = c + (x * y); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := If[Or[LessEqual[z, -5.7e+181], N[Not[LessEqual[z, 2e-55]], $MachinePrecision]], N[(z * N[(t * 0.0625), $MachinePrecision]), $MachinePrecision], N[(c + N[(x * y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -5.7 \cdot 10^{+181} \lor \neg \left(z \leq 2 \cdot 10^{-55}\right):\\
\;\;\;\;z \cdot \left(t \cdot 0.0625\right)\\
\mathbf{else}:\\
\;\;\;\;c + x \cdot y\\
\end{array}
\end{array}
if z < -5.7000000000000002e181 or 1.99999999999999999e-55 < z Initial program 95.5%
Taylor expanded in x around 0 78.0%
Taylor expanded in z around inf 78.9%
associate--l+78.9%
associate-*r/78.9%
div-sub78.9%
*-commutative78.9%
cancel-sign-sub-inv78.9%
distribute-lft-neg-in78.9%
distribute-rgt-neg-in78.9%
metadata-eval78.9%
associate-*r*78.9%
Simplified78.9%
Taylor expanded in t around inf 48.0%
if -5.7000000000000002e181 < z < 1.99999999999999999e-55Initial program 99.4%
Taylor expanded in a around 0 72.1%
Taylor expanded in t around 0 58.7%
+-commutative58.7%
Simplified58.7%
Final simplification54.1%
(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.7%
Taylor expanded in c around inf 21.0%
herbie shell --seed 2024129
(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))