
(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 9 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 98.0%
associate--l+98.0%
fma-define98.0%
associate-/l*98.0%
fma-neg98.4%
distribute-neg-frac298.4%
metadata-eval98.4%
Simplified98.4%
(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 98.0%
associate-+l-98.0%
*-commutative98.0%
associate-+l-98.0%
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 (+ c (* a (* b -0.25))))
(t_2 (+ c (* z (* t 0.0625))))
(t_3 (+ c (* x y))))
(if (<= (* x y) -7e+59)
t_3
(if (<= (* x y) -2.8e-32)
t_1
(if (<= (* x y) -1.45e-115)
t_2
(if (<= (* x y) -1.95e-241)
t_1
(if (<= (* x y) 2.15e-263)
t_2
(if (<= (* x y) 1.8e+69) t_1 t_3))))))))
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 t_2 = c + (z * (t * 0.0625));
double t_3 = c + (x * y);
double tmp;
if ((x * y) <= -7e+59) {
tmp = t_3;
} else if ((x * y) <= -2.8e-32) {
tmp = t_1;
} else if ((x * y) <= -1.45e-115) {
tmp = t_2;
} else if ((x * y) <= -1.95e-241) {
tmp = t_1;
} else if ((x * y) <= 2.15e-263) {
tmp = t_2;
} else if ((x * y) <= 1.8e+69) {
tmp = t_1;
} else {
tmp = t_3;
}
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) :: t_3
real(8) :: tmp
t_1 = c + (a * (b * (-0.25d0)))
t_2 = c + (z * (t * 0.0625d0))
t_3 = c + (x * y)
if ((x * y) <= (-7d+59)) then
tmp = t_3
else if ((x * y) <= (-2.8d-32)) then
tmp = t_1
else if ((x * y) <= (-1.45d-115)) then
tmp = t_2
else if ((x * y) <= (-1.95d-241)) then
tmp = t_1
else if ((x * y) <= 2.15d-263) then
tmp = t_2
else if ((x * y) <= 1.8d+69) then
tmp = t_1
else
tmp = t_3
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 t_2 = c + (z * (t * 0.0625));
double t_3 = c + (x * y);
double tmp;
if ((x * y) <= -7e+59) {
tmp = t_3;
} else if ((x * y) <= -2.8e-32) {
tmp = t_1;
} else if ((x * y) <= -1.45e-115) {
tmp = t_2;
} else if ((x * y) <= -1.95e-241) {
tmp = t_1;
} else if ((x * y) <= 2.15e-263) {
tmp = t_2;
} else if ((x * y) <= 1.8e+69) {
tmp = t_1;
} else {
tmp = t_3;
}
return tmp;
}
def code(x, y, z, t, a, b, c): t_1 = c + (a * (b * -0.25)) t_2 = c + (z * (t * 0.0625)) t_3 = c + (x * y) tmp = 0 if (x * y) <= -7e+59: tmp = t_3 elif (x * y) <= -2.8e-32: tmp = t_1 elif (x * y) <= -1.45e-115: tmp = t_2 elif (x * y) <= -1.95e-241: tmp = t_1 elif (x * y) <= 2.15e-263: tmp = t_2 elif (x * y) <= 1.8e+69: tmp = t_1 else: tmp = t_3 return tmp
function code(x, y, z, t, a, b, c) t_1 = Float64(c + Float64(a * Float64(b * -0.25))) t_2 = Float64(c + Float64(z * Float64(t * 0.0625))) t_3 = Float64(c + Float64(x * y)) tmp = 0.0 if (Float64(x * y) <= -7e+59) tmp = t_3; elseif (Float64(x * y) <= -2.8e-32) tmp = t_1; elseif (Float64(x * y) <= -1.45e-115) tmp = t_2; elseif (Float64(x * y) <= -1.95e-241) tmp = t_1; elseif (Float64(x * y) <= 2.15e-263) tmp = t_2; elseif (Float64(x * y) <= 1.8e+69) tmp = t_1; else tmp = t_3; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) t_1 = c + (a * (b * -0.25)); t_2 = c + (z * (t * 0.0625)); t_3 = c + (x * y); tmp = 0.0; if ((x * y) <= -7e+59) tmp = t_3; elseif ((x * y) <= -2.8e-32) tmp = t_1; elseif ((x * y) <= -1.45e-115) tmp = t_2; elseif ((x * y) <= -1.95e-241) tmp = t_1; elseif ((x * y) <= 2.15e-263) tmp = t_2; elseif ((x * y) <= 1.8e+69) tmp = t_1; else tmp = t_3; 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]}, Block[{t$95$2 = N[(c + N[(z * N[(t * 0.0625), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(c + N[(x * y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x * y), $MachinePrecision], -7e+59], t$95$3, If[LessEqual[N[(x * y), $MachinePrecision], -2.8e-32], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], -1.45e-115], t$95$2, If[LessEqual[N[(x * y), $MachinePrecision], -1.95e-241], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], 2.15e-263], t$95$2, If[LessEqual[N[(x * y), $MachinePrecision], 1.8e+69], t$95$1, t$95$3]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := c + a \cdot \left(b \cdot -0.25\right)\\
t_2 := c + z \cdot \left(t \cdot 0.0625\right)\\
t_3 := c + x \cdot y\\
\mathbf{if}\;x \cdot y \leq -7 \cdot 10^{+59}:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;x \cdot y \leq -2.8 \cdot 10^{-32}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \cdot y \leq -1.45 \cdot 10^{-115}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;x \cdot y \leq -1.95 \cdot 10^{-241}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \cdot y \leq 2.15 \cdot 10^{-263}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;x \cdot y \leq 1.8 \cdot 10^{+69}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_3\\
\end{array}
\end{array}
if (*.f64 x y) < -7e59 or 1.8000000000000001e69 < (*.f64 x y) Initial program 97.7%
Taylor expanded in x around inf 75.9%
if -7e59 < (*.f64 x y) < -2.7999999999999999e-32 or -1.4499999999999999e-115 < (*.f64 x y) < -1.9499999999999999e-241 or 2.14999999999999985e-263 < (*.f64 x y) < 1.8000000000000001e69Initial program 98.0%
Taylor expanded in a around inf 73.6%
*-commutative73.6%
associate-*r*73.6%
Simplified73.6%
if -2.7999999999999999e-32 < (*.f64 x y) < -1.4499999999999999e-115 or -1.9499999999999999e-241 < (*.f64 x y) < 2.14999999999999985e-263Initial program 98.5%
Taylor expanded in z around inf 75.5%
*-commutative75.5%
*-commutative75.5%
associate-*r*75.5%
*-commutative75.5%
Simplified75.5%
Final simplification74.9%
(FPCore (x y z t a b c) :precision binary64 (if (or (<= (* a b) -5000000000.0) (not (<= (* a b) 5e+166))) (+ 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) <= -5000000000.0) || !((a * b) <= 5e+166)) {
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) <= (-5000000000.0d0)) .or. (.not. ((a * b) <= 5d+166))) 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) <= -5000000000.0) || !((a * b) <= 5e+166)) {
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) <= -5000000000.0) or not ((a * b) <= 5e+166): 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) <= -5000000000.0) || !(Float64(a * b) <= 5e+166)) tmp = Float64(c + 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) <= -5000000000.0) || ~(((a * b) <= 5e+166))) 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], -5000000000.0], N[Not[LessEqual[N[(a * b), $MachinePrecision], 5e+166]], $MachinePrecision]], N[(c + N[(N[(x * y), $MachinePrecision] - N[(N[(a * b), $MachinePrecision] * 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 -5000000000 \lor \neg \left(a \cdot b \leq 5 \cdot 10^{+166}\right):\\
\;\;\;\;c + \left(x \cdot y - \left(a \cdot b\right) \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) < -5e9 or 5.0000000000000002e166 < (*.f64 a b) Initial program 95.9%
Taylor expanded in z around 0 91.1%
if -5e9 < (*.f64 a b) < 5.0000000000000002e166Initial program 99.3%
Taylor expanded in a around 0 94.4%
Final simplification93.1%
(FPCore (x y z t a b c) :precision binary64 (if (or (<= a -1.04e+160) (not (<= a 52000.0))) (+ c (* 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 <= -1.04e+160) || !(a <= 52000.0)) {
tmp = c + (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 <= (-1.04d+160)) .or. (.not. (a <= 52000.0d0))) then
tmp = c + (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 <= -1.04e+160) || !(a <= 52000.0)) {
tmp = c + (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 <= -1.04e+160) or not (a <= 52000.0): tmp = c + (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 ((a <= -1.04e+160) || !(a <= 52000.0)) tmp = Float64(c + Float64(a * Float64(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 <= -1.04e+160) || ~((a <= 52000.0))) tmp = c + (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[a, -1.04e+160], N[Not[LessEqual[a, 52000.0]], $MachinePrecision]], N[(c + N[(a * N[(b * -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 \leq -1.04 \cdot 10^{+160} \lor \neg \left(a \leq 52000\right):\\
\;\;\;\;c + a \cdot \left(b \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 a < -1.04e160 or 52000 < a Initial program 96.9%
Taylor expanded in a around inf 66.2%
*-commutative66.2%
associate-*r*66.2%
Simplified66.2%
if -1.04e160 < a < 52000Initial program 98.7%
Taylor expanded in a around 0 90.3%
Final simplification81.1%
(FPCore (x y z t a b c) :precision binary64 (if (or (<= (* x y) -4.8e+59) (not (<= (* x y) 7e+68))) (+ 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) <= -4.8e+59) || !((x * y) <= 7e+68)) {
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) <= (-4.8d+59)) .or. (.not. ((x * y) <= 7d+68))) 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) <= -4.8e+59) || !((x * y) <= 7e+68)) {
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) <= -4.8e+59) or not ((x * y) <= 7e+68): 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) <= -4.8e+59) || !(Float64(x * y) <= 7e+68)) 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) <= -4.8e+59) || ~(((x * y) <= 7e+68))) 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], -4.8e+59], N[Not[LessEqual[N[(x * y), $MachinePrecision], 7e+68]], $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 -4.8 \cdot 10^{+59} \lor \neg \left(x \cdot y \leq 7 \cdot 10^{+68}\right):\\
\;\;\;\;c + x \cdot y\\
\mathbf{else}:\\
\;\;\;\;c + a \cdot \left(b \cdot -0.25\right)\\
\end{array}
\end{array}
if (*.f64 x y) < -4.8000000000000004e59 or 6.99999999999999955e68 < (*.f64 x y) Initial program 97.7%
Taylor expanded in x around inf 75.9%
if -4.8000000000000004e59 < (*.f64 x y) < 6.99999999999999955e68Initial program 98.2%
Taylor expanded in a around inf 66.0%
*-commutative66.0%
associate-*r*66.0%
Simplified66.0%
Final simplification69.4%
(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 98.0%
Final simplification98.0%
(FPCore (x y z t a b c) :precision binary64 (+ c (* x y)))
double code(double x, double y, double z, double t, double a, double b, double c) {
return c + (x * y);
}
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)
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
return c + (x * y);
}
def code(x, y, z, t, a, b, c): return c + (x * y)
function code(x, y, z, t, a, b, c) return Float64(c + Float64(x * y)) end
function tmp = code(x, y, z, t, a, b, c) tmp = c + (x * y); end
code[x_, y_, z_, t_, a_, b_, c_] := N[(c + N[(x * y), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
c + x \cdot y
\end{array}
Initial program 98.0%
Taylor expanded in x around inf 48.7%
Final simplification48.7%
(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 98.0%
Taylor expanded in a around 0 73.1%
metadata-eval73.1%
*-commutative73.1%
associate-/r/73.1%
*-commutative73.1%
associate-/r*73.0%
Applied egg-rr73.0%
Taylor expanded in c around inf 24.6%
herbie shell --seed 2024111
(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))