?

Average Error: 0.1 → 0.0
Time: 10.5s
Precision: binary64
Cost: 7232

?

\[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 + \left(z + \left(y + z\right)\right)\right) + 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 (+ y z))) 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 + (y + z))) + 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(y + Float64(z + Float64(y + z))) + 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[(y + N[(z + N[(y + z), $MachinePrecision]), $MachinePrecision]), $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 + \left(z + \left(y + z\right)\right)\right) + t\right)\right)

Error?

Derivation?

  1. Initial program 0.1

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

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

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

Alternatives

Alternative 1
Error36.1
Cost1376
\[\begin{array}{l} t_1 := 2 \cdot \left(x \cdot z\right)\\ \mathbf{if}\;z \leq -3.55 \cdot 10^{+142}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq -3.3 \cdot 10^{-90}:\\ \;\;\;\;y \cdot 5\\ \mathbf{elif}\;z \leq -2.3 \cdot 10^{-155}:\\ \;\;\;\;x \cdot t\\ \mathbf{elif}\;z \leq 1.95 \cdot 10^{-202}:\\ \;\;\;\;y \cdot 5\\ \mathbf{elif}\;z \leq 1.1 \cdot 10^{-132}:\\ \;\;\;\;y \cdot \left(x \cdot 2\right)\\ \mathbf{elif}\;z \leq 4.2 \cdot 10^{-119}:\\ \;\;\;\;y \cdot 5\\ \mathbf{elif}\;z \leq 19000:\\ \;\;\;\;x \cdot t\\ \mathbf{elif}\;z \leq 4.4 \cdot 10^{+60}:\\ \;\;\;\;y \cdot 5\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 2
Error28.8
Cost1240
\[\begin{array}{l} t_1 := x \cdot \left(t + y \cdot 2\right)\\ t_2 := y \cdot \left(5 + x \cdot 2\right)\\ \mathbf{if}\;z \leq -7.5 \cdot 10^{+138}:\\ \;\;\;\;2 \cdot \left(x \cdot z\right)\\ \mathbf{elif}\;z \leq -1.8 \cdot 10^{-90}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;z \leq -1.02 \cdot 10^{-154}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq 4 \cdot 10^{-119}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;z \leq 30000:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq 2.7 \cdot 10^{+57}:\\ \;\;\;\;t_2\\ \mathbf{else}:\\ \;\;\;\;\left(y + z\right) \cdot \left(x \cdot 2\right)\\ \end{array} \]
Alternative 3
Error35.1
Cost1112
\[\begin{array}{l} t_1 := 2 \cdot \left(x \cdot z\right)\\ \mathbf{if}\;z \leq -7 \cdot 10^{+146}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq -2 \cdot 10^{-90}:\\ \;\;\;\;y \cdot 5\\ \mathbf{elif}\;z \leq -1.02 \cdot 10^{-154}:\\ \;\;\;\;x \cdot t\\ \mathbf{elif}\;z \leq 3.1 \cdot 10^{-119}:\\ \;\;\;\;y \cdot 5\\ \mathbf{elif}\;z \leq 19000:\\ \;\;\;\;x \cdot t\\ \mathbf{elif}\;z \leq 4 \cdot 10^{+60}:\\ \;\;\;\;y \cdot 5\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 4
Error15.1
Cost978
\[\begin{array}{l} \mathbf{if}\;y \leq -4.2 \cdot 10^{-73} \lor \neg \left(y \leq 4.5 \cdot 10^{-60}\right) \land \left(y \leq 5.8 \cdot 10^{-36} \lor \neg \left(y \leq 0.00096\right)\right):\\ \;\;\;\;y \cdot \left(5 + x \cdot 2\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(t + z \cdot 2\right)\\ \end{array} \]
Alternative 5
Error0.7
Cost969
\[\begin{array}{l} \mathbf{if}\;x \leq -26 \lor \neg \left(x \leq 9.5 \cdot 10^{-8}\right):\\ \;\;\;\;x \cdot \left(t + \left(y + z\right) \cdot 2\right)\\ \mathbf{else}:\\ \;\;\;\;y \cdot 5 + x \cdot \left(t + z \cdot 2\right)\\ \end{array} \]
Alternative 6
Error0.1
Cost960
\[x \cdot \left(\left(y + \left(z + \left(y + z\right)\right)\right) + t\right) + y \cdot 5 \]
Alternative 7
Error0.1
Cost960
\[\left(y \cdot 5 + x \cdot \left(\left(y + z\right) \cdot 2\right)\right) + x \cdot t \]
Alternative 8
Error26.1
Cost844
\[\begin{array}{l} t_1 := x \cdot \left(t + y \cdot 2\right)\\ \mathbf{if}\;x \leq -7 \cdot 10^{-26}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;x \leq 1.15 \cdot 10^{-18}:\\ \;\;\;\;y \cdot 5\\ \mathbf{elif}\;x \leq 6.9 \cdot 10^{+16}:\\ \;\;\;\;2 \cdot \left(x \cdot z\right)\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 9
Error25.7
Cost844
\[\begin{array}{l} t_1 := \left(y + z\right) \cdot \left(x \cdot 2\right)\\ \mathbf{if}\;x \leq -6 \cdot 10^{-27}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;x \leq 4.1 \cdot 10^{-19}:\\ \;\;\;\;y \cdot 5\\ \mathbf{elif}\;x \leq 1.05 \cdot 10^{+20}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(t + y \cdot 2\right)\\ \end{array} \]
Alternative 10
Error9.7
Cost841
\[\begin{array}{l} \mathbf{if}\;x \leq -2.1 \cdot 10^{-25} \lor \neg \left(x \leq 1.9 \cdot 10^{-19}\right):\\ \;\;\;\;x \cdot \left(t + \left(y + z\right) \cdot 2\right)\\ \mathbf{else}:\\ \;\;\;\;y \cdot 5 + x \cdot t\\ \end{array} \]
Alternative 11
Error9.9
Cost841
\[\begin{array}{l} \mathbf{if}\;x \leq -1.1 \cdot 10^{-23} \lor \neg \left(x \leq 2.35 \cdot 10^{-13}\right):\\ \;\;\;\;x \cdot \left(t + \left(y + z\right) \cdot 2\right)\\ \mathbf{else}:\\ \;\;\;\;y \cdot 5 + x \cdot \left(z + z\right)\\ \end{array} \]
Alternative 12
Error32.2
Cost456
\[\begin{array}{l} \mathbf{if}\;x \leq -1.7 \cdot 10^{-25}:\\ \;\;\;\;x \cdot t\\ \mathbf{elif}\;x \leq 1.45 \cdot 10^{-7}:\\ \;\;\;\;y \cdot 5\\ \mathbf{else}:\\ \;\;\;\;x \cdot t\\ \end{array} \]
Alternative 13
Error46.7
Cost192
\[x \cdot t \]

Error

Reproduce?

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