?

Average Accuracy: 99.9% → 100.0%
Time: 11.6s
Precision: binary64
Cost: 7104

?

\[x \cdot \left(\left(\left(\left(y + z\right) + z\right) + y\right) + t\right) + y \cdot 5 \]
\[\mathsf{fma}\left(y, 5, x \cdot \left(\left(y + z\right) \cdot 2 + t\right)\right) \]
(FPCore (x y z t)
 :precision binary64
 (+ (* x (+ (+ (+ (+ y z) z) y) t)) (* y 5.0)))
(FPCore (x y z t) :precision binary64 (fma y 5.0 (* x (+ (* (+ y z) 2.0) t))))
double code(double x, double y, double z, double t) {
	return (x * ((((y + z) + z) + y) + t)) + (y * 5.0);
}
double code(double x, double y, double z, double t) {
	return fma(y, 5.0, (x * (((y + z) * 2.0) + t)));
}
function code(x, y, z, t)
	return Float64(Float64(x * Float64(Float64(Float64(Float64(y + z) + z) + y) + t)) + Float64(y * 5.0))
end
function code(x, y, z, t)
	return fma(y, 5.0, Float64(x * Float64(Float64(Float64(y + z) * 2.0) + t)))
end
code[x_, y_, z_, t_] := N[(N[(x * N[(N[(N[(N[(y + z), $MachinePrecision] + z), $MachinePrecision] + y), $MachinePrecision] + t), $MachinePrecision]), $MachinePrecision] + N[(y * 5.0), $MachinePrecision]), $MachinePrecision]
code[x_, y_, z_, t_] := N[(y * 5.0 + N[(x * N[(N[(N[(y + z), $MachinePrecision] * 2.0), $MachinePrecision] + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
x \cdot \left(\left(\left(\left(y + z\right) + z\right) + y\right) + t\right) + y \cdot 5
\mathsf{fma}\left(y, 5, x \cdot \left(\left(y + z\right) \cdot 2 + t\right)\right)

Error?

Derivation?

  1. Initial program 99.9%

    \[x \cdot \left(\left(\left(\left(y + z\right) + z\right) + y\right) + t\right) + y \cdot 5 \]
  2. Applied egg-rr100.0%

    \[\leadsto \color{blue}{\mathsf{fma}\left(y, 5, x \cdot \left(\left(y + z\right) \cdot 2 + t\right)\right)} \]
  3. Final simplification100.0%

    \[\leadsto \mathsf{fma}\left(y, 5, x \cdot \left(\left(y + z\right) \cdot 2 + t\right)\right) \]

Alternatives

Alternative 1
Accuracy99.9%
Cost7104
\[\mathsf{fma}\left(x, \left(y + z\right) \cdot 2 + t, y \cdot 5\right) \]
Alternative 2
Accuracy51.2%
Cost1373
\[\begin{array}{l} t_1 := \left(y + z\right) \cdot \left(x + x\right)\\ \mathbf{if}\;y \leq -8.5 \cdot 10^{-92}:\\ \;\;\;\;y \cdot 5\\ \mathbf{elif}\;y \leq 7.2 \cdot 10^{-293}:\\ \;\;\;\;x \cdot t\\ \mathbf{elif}\;y \leq 2.55 \cdot 10^{-173}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y \leq 9.8 \cdot 10^{-128}:\\ \;\;\;\;x \cdot t\\ \mathbf{elif}\;y \leq 7.8 \cdot 10^{-32} \lor \neg \left(y \leq 8.6 \cdot 10^{+14}\right) \land y \leq 3.2 \cdot 10^{+68}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;y \cdot 5\\ \end{array} \]
Alternative 3
Accuracy82.9%
Cost1233
\[\begin{array}{l} t_1 := y \cdot 5 + 2 \cdot \left(x \cdot \left(y + z\right)\right)\\ \mathbf{if}\;y \leq -6 \cdot 10^{+99}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y \leq -6.8 \cdot 10^{-40}:\\ \;\;\;\;y \cdot 5 + x \cdot t\\ \mathbf{elif}\;y \leq -8.5 \cdot 10^{-92} \lor \neg \left(y \leq 5 \cdot 10^{-27}\right):\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(\left(y + z\right) \cdot 2 + t\right)\\ \end{array} \]
Alternative 4
Accuracy59.9%
Cost1108
\[\begin{array}{l} t_1 := \left(y + z\right) \cdot \left(x + x\right)\\ t_2 := y \cdot \left(5 + x \cdot 2\right)\\ \mathbf{if}\;y \leq -1.1 \cdot 10^{-91}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;y \leq 5.4 \cdot 10^{-291}:\\ \;\;\;\;x \cdot t\\ \mathbf{elif}\;y \leq 5.2 \cdot 10^{-174}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y \leq 1.55 \cdot 10^{-127}:\\ \;\;\;\;x \cdot t\\ \mathbf{elif}\;y \leq 2.6 \cdot 10^{-34}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;t_2\\ \end{array} \]
Alternative 5
Accuracy84.9%
Cost1104
\[\begin{array}{l} t_1 := y \cdot 5 + x \cdot t\\ t_2 := x \cdot \left(\left(y + z\right) \cdot 2 + t\right)\\ \mathbf{if}\;x \leq -5 \cdot 10^{-24}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;x \leq -8.5 \cdot 10^{-146}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;x \leq -3.4 \cdot 10^{-159}:\\ \;\;\;\;x \cdot \left(t + z \cdot 2\right)\\ \mathbf{elif}\;x \leq 4.5 \cdot 10^{-13}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;t_2\\ \end{array} \]
Alternative 6
Accuracy84.9%
Cost1104
\[\begin{array}{l} t_1 := y \cdot 5 + x \cdot t\\ t_2 := x \cdot \left(\left(y + z\right) \cdot 2 + t\right)\\ \mathbf{if}\;x \leq -4.9 \cdot 10^{-24}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;x \leq -8.5 \cdot 10^{-146}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;x \leq -3.4 \cdot 10^{-159}:\\ \;\;\;\;x \cdot t + x \cdot \left(z \cdot 2\right)\\ \mathbf{elif}\;x \leq 8 \cdot 10^{-14}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;t_2\\ \end{array} \]
Alternative 7
Accuracy50.3%
Cost984
\[\begin{array}{l} t_1 := 2 \cdot \left(x \cdot z\right)\\ \mathbf{if}\;y \leq -1.15 \cdot 10^{-91}:\\ \;\;\;\;y \cdot 5\\ \mathbf{elif}\;y \leq 10^{-290}:\\ \;\;\;\;x \cdot t\\ \mathbf{elif}\;y \leq 3.7 \cdot 10^{-176}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y \leq 3.3 \cdot 10^{-127}:\\ \;\;\;\;x \cdot t\\ \mathbf{elif}\;y \leq 1.5 \cdot 10^{-98}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y \leq 5.7 \cdot 10^{-27}:\\ \;\;\;\;x \cdot t\\ \mathbf{else}:\\ \;\;\;\;y \cdot 5\\ \end{array} \]
Alternative 8
Accuracy99.9%
Cost960
\[y \cdot 5 + x \cdot \left(t + \left(y + \left(y + z \cdot 2\right)\right)\right) \]
Alternative 9
Accuracy99.9%
Cost960
\[y \cdot 5 + \left(x \cdot \left(\left(y + z\right) \cdot 2\right) + x \cdot t\right) \]
Alternative 10
Accuracy77.2%
Cost844
\[\begin{array}{l} t_1 := y \cdot \left(5 + x \cdot 2\right)\\ \mathbf{if}\;y \leq -7.2 \cdot 10^{+114}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y \leq -3.7 \cdot 10^{-87}:\\ \;\;\;\;y \cdot 5 + x \cdot t\\ \mathbf{elif}\;y \leq 2.9 \cdot 10^{-27}:\\ \;\;\;\;x \cdot \left(t + z \cdot 2\right)\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 11
Accuracy76.6%
Cost713
\[\begin{array}{l} \mathbf{if}\;y \leq -3.8 \cdot 10^{+62} \lor \neg \left(y \leq 5.4 \cdot 10^{-27}\right):\\ \;\;\;\;y \cdot \left(5 + x \cdot 2\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(t + z \cdot 2\right)\\ \end{array} \]
Alternative 12
Accuracy50.8%
Cost456
\[\begin{array}{l} \mathbf{if}\;y \leq -9 \cdot 10^{-92}:\\ \;\;\;\;y \cdot 5\\ \mathbf{elif}\;y \leq 5.4 \cdot 10^{-27}:\\ \;\;\;\;x \cdot t\\ \mathbf{else}:\\ \;\;\;\;y \cdot 5\\ \end{array} \]
Alternative 13
Accuracy26.7%
Cost192
\[x \cdot t \]

Error

Reproduce?

herbie shell --seed 2023141 
(FPCore (x y z t)
  :name "Graphics.Rendering.Plot.Render.Plot.Legend:renderLegendOutside from plot-0.2.3.4, B"
  :precision binary64
  (+ (* x (+ (+ (+ (+ y z) z) y) t)) (* y 5.0)))