Average Error: 0.1 → 0.0
Time: 10.9s
Precision: binary64
Cost: 7360
\[\left(\left(x \cdot y + \frac{z \cdot t}{16}\right) - \frac{a \cdot b}{4}\right) + c \]
\[\left(\mathsf{fma}\left(z, t \cdot 0.0625, \left(a \cdot b\right) \cdot -0.25\right) + x \cdot y\right) + c \]
(FPCore (x y z t a b c)
 :precision binary64
 (+ (- (+ (* x y) (/ (* z t) 16.0)) (/ (* a b) 4.0)) c))
(FPCore (x y z t a b c)
 :precision binary64
 (+ (+ (fma z (* t 0.0625) (* (* a b) -0.25)) (* x y)) 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;
}
double code(double x, double y, double z, double t, double a, double b, double c) {
	return (fma(z, (t * 0.0625), ((a * b) * -0.25)) + (x * y)) + 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 code(x, y, z, t, a, b, c)
	return Float64(Float64(fma(z, Float64(t * 0.0625), Float64(Float64(a * b) * -0.25)) + Float64(x * y)) + 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]
code[x_, y_, z_, t_, a_, b_, c_] := N[(N[(N[(z * N[(t * 0.0625), $MachinePrecision] + N[(N[(a * b), $MachinePrecision] * -0.25), $MachinePrecision]), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision] + c), $MachinePrecision]
\left(\left(x \cdot y + \frac{z \cdot t}{16}\right) - \frac{a \cdot b}{4}\right) + c
\left(\mathsf{fma}\left(z, t \cdot 0.0625, \left(a \cdot b\right) \cdot -0.25\right) + x \cdot y\right) + c

Error

Derivation

  1. Initial program 0.1

    \[\left(\left(x \cdot y + \frac{z \cdot t}{16}\right) - \frac{a \cdot b}{4}\right) + c \]
  2. Applied egg-rr0.0

    \[\leadsto \color{blue}{\left(\mathsf{fma}\left(z, t \cdot 0.0625, \left(a \cdot b\right) \cdot -0.25\right) + x \cdot y\right)} + c \]
  3. Final simplification0.0

    \[\leadsto \left(\mathsf{fma}\left(z, t \cdot 0.0625, \left(a \cdot b\right) \cdot -0.25\right) + x \cdot y\right) + c \]

Alternatives

Alternative 1
Error25.3
Cost1636
\[\begin{array}{l} t_1 := c + z \cdot \left(t \cdot 0.0625\right)\\ t_2 := c + x \cdot y\\ t_3 := c + a \cdot \left(b \cdot -0.25\right)\\ \mathbf{if}\;y \leq -1.5357625516276445 \cdot 10^{-170}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;y \leq 1.03735698837011 \cdot 10^{-232}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y \leq 2.384567044945078 \cdot 10^{-196}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;y \leq 2.241406679171589 \cdot 10^{-45}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y \leq 8.42187534318442 \cdot 10^{-35}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;y \leq 7.655425452163936 \cdot 10^{-11}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y \leq 1.95 \cdot 10^{+77}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;y \leq 4.9 \cdot 10^{+89}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;y \leq 1.05 \cdot 10^{+131}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;t_2\\ \end{array} \]
Alternative 2
Error27.0
Cost1632
\[\begin{array}{l} t_1 := c + a \cdot \left(b \cdot -0.25\right)\\ t_2 := x \cdot y + 0.0625 \cdot \left(z \cdot t\right)\\ \mathbf{if}\;t \leq -3.821248132633479 \cdot 10^{-49}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;t \leq -1.0396426548605189 \cdot 10^{-134}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;t \leq -3.4605129582150747 \cdot 10^{-189}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;t \leq -1.6185902390482583 \cdot 10^{-292}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;t \leq 8.474371110172211 \cdot 10^{-231}:\\ \;\;\;\;c + x \cdot y\\ \mathbf{elif}\;t \leq 2.062300401758068 \cdot 10^{-47}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;t \leq 4.764622623618078 \cdot 10^{+21}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;t \leq 10^{+144}:\\ \;\;\;\;c + z \cdot \left(t \cdot 0.0625\right)\\ \mathbf{else}:\\ \;\;\;\;t_2\\ \end{array} \]
Alternative 3
Error15.5
Cost1232
\[\begin{array}{l} t_1 := c + \left(x \cdot y + 0.0625 \cdot \left(z \cdot t\right)\right)\\ t_2 := c + a \cdot \left(b \cdot -0.25\right)\\ \mathbf{if}\;b \leq -2.9586790175607394 \cdot 10^{-70}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;b \leq 9.5 \cdot 10^{+134}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;b \leq 1.2 \cdot 10^{+154}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;b \leq 3.3 \cdot 10^{+238}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;t_2\\ \end{array} \]
Alternative 4
Error5.9
Cost1224
\[\begin{array}{l} t_1 := c + \left(\left(a \cdot b\right) \cdot -0.25 + x \cdot y\right)\\ \mathbf{if}\;a \cdot b \leq -1 \cdot 10^{+89}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;a \cdot b \leq 10^{+62}:\\ \;\;\;\;c + \left(x \cdot y + 0.0625 \cdot \left(z \cdot t\right)\right)\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 5
Error0.0
Cost1088
\[c + \left(\left(t \cdot \frac{z}{16} + x \cdot y\right) - \frac{a \cdot b}{4}\right) \]
Alternative 6
Error25.2
Cost976
\[\begin{array}{l} t_1 := c + z \cdot \left(t \cdot 0.0625\right)\\ t_2 := c + x \cdot y\\ \mathbf{if}\;y \leq -1.5357625516276445 \cdot 10^{-170}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;y \leq 7.655425452163936 \cdot 10^{-11}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y \leq 1.95 \cdot 10^{+77}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;y \leq 1.05 \cdot 10^{+131}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;t_2\\ \end{array} \]
Alternative 7
Error30.6
Cost848
\[\begin{array}{l} t_1 := c + x \cdot y\\ t_2 := z \cdot \left(t \cdot 0.0625\right)\\ \mathbf{if}\;z \leq -9.4 \cdot 10^{+253}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;z \leq -1.15 \cdot 10^{+142}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq -2.2 \cdot 10^{+100}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;z \leq 1.4518390422816507 \cdot 10^{-34}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;t_2\\ \end{array} \]
Alternative 8
Error35.3
Cost584
\[\begin{array}{l} \mathbf{if}\;c \leq -7.771146013103411 \cdot 10^{+34}:\\ \;\;\;\;c\\ \mathbf{elif}\;c \leq 4.5129907497975306 \cdot 10^{+55}:\\ \;\;\;\;z \cdot \left(t \cdot 0.0625\right)\\ \mathbf{else}:\\ \;\;\;\;c\\ \end{array} \]
Alternative 9
Error35.6
Cost456
\[\begin{array}{l} \mathbf{if}\;c \leq -2.7771066864780436 \cdot 10^{+77}:\\ \;\;\;\;c\\ \mathbf{elif}\;c \leq 2.2626027891066385 \cdot 10^{+79}:\\ \;\;\;\;x \cdot y\\ \mathbf{else}:\\ \;\;\;\;c\\ \end{array} \]
Alternative 10
Error43.9
Cost64
\[c \]

Error

Reproduce

herbie shell --seed 2022317 
(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))