?

Average Error: 0.1 → 0.0
Time: 10.9s
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 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(y + z\right) \cdot 2 + t\right)\right)} \]
  3. Final simplification0.0

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

Alternatives

Alternative 1
Error30.8
Cost1504
\[\begin{array}{l} t_1 := 2 \cdot \left(x \cdot z\right)\\ t_2 := x \cdot \left(t + y \cdot 2\right)\\ \mathbf{if}\;y \leq -6.4 \cdot 10^{+59}:\\ \;\;\;\;y \cdot 5\\ \mathbf{elif}\;y \leq -1.25 \cdot 10^{-111}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;y \leq -7.5 \cdot 10^{-135}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y \leq -7.8 \cdot 10^{-189}:\\ \;\;\;\;x \cdot t\\ \mathbf{elif}\;y \leq 3.2 \cdot 10^{-217}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y \leq 4.6 \cdot 10^{-64}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;y \leq 2.05 \cdot 10^{-25}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y \leq 7.8 \cdot 10^{+74}:\\ \;\;\;\;t_2\\ \mathbf{else}:\\ \;\;\;\;y \cdot 5\\ \end{array} \]
Alternative 2
Error30.7
Cost1504
\[\begin{array}{l} t_1 := \left(y + z\right) \cdot \left(x \cdot 2\right)\\ t_2 := x \cdot \left(t + y \cdot 2\right)\\ \mathbf{if}\;y \leq -1.8 \cdot 10^{+61}:\\ \;\;\;\;y \cdot 5\\ \mathbf{elif}\;y \leq -2.5 \cdot 10^{-108}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;y \leq -3.9 \cdot 10^{-135}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y \leq -2.2 \cdot 10^{-186}:\\ \;\;\;\;x \cdot t\\ \mathbf{elif}\;y \leq 2.5 \cdot 10^{-186}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y \leq 2.4 \cdot 10^{-63}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;y \leq 7.2 \cdot 10^{-29}:\\ \;\;\;\;2 \cdot \left(x \cdot z\right)\\ \mathbf{elif}\;y \leq 5.1 \cdot 10^{+76}:\\ \;\;\;\;t_2\\ \mathbf{else}:\\ \;\;\;\;y \cdot 5\\ \end{array} \]
Alternative 3
Error10.3
Cost1365
\[\begin{array}{l} t_1 := x \cdot \left(\left(y + z\right) \cdot 2 + t\right)\\ \mathbf{if}\;x \leq -0.1:\\ \;\;\;\;t_1\\ \mathbf{elif}\;x \leq -4.4 \cdot 10^{-164}:\\ \;\;\;\;y \cdot 5 + x \cdot t\\ \mathbf{elif}\;x \leq 1.6 \cdot 10^{-94} \lor \neg \left(x \leq 1.35 \cdot 10^{-29}\right) \land x \leq 0.016:\\ \;\;\;\;y \cdot 5 + 2 \cdot \left(x \cdot \left(y + z\right)\right)\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 4
Error31.2
Cost1116
\[\begin{array}{l} t_1 := 2 \cdot \left(x \cdot z\right)\\ \mathbf{if}\;y \leq -1.12 \cdot 10^{-86}:\\ \;\;\;\;y \cdot 5\\ \mathbf{elif}\;y \leq -7.8 \cdot 10^{-134}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y \leq -1.1 \cdot 10^{-188}:\\ \;\;\;\;x \cdot t\\ \mathbf{elif}\;y \leq 1.8 \cdot 10^{-216}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y \leq 4.2 \cdot 10^{-64}:\\ \;\;\;\;x \cdot t\\ \mathbf{elif}\;y \leq 2.3 \cdot 10^{-25}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y \leq 2.15 \cdot 10^{-16}:\\ \;\;\;\;x \cdot t\\ \mathbf{else}:\\ \;\;\;\;y \cdot 5\\ \end{array} \]
Alternative 5
Error24.9
Cost1108
\[\begin{array}{l} t_1 := \left(y + z\right) \cdot \left(x \cdot 2\right)\\ t_2 := y \cdot \left(5 + x \cdot 2\right)\\ \mathbf{if}\;y \leq -5 \cdot 10^{-86}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;y \leq -2.8 \cdot 10^{-135}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y \leq -1.1 \cdot 10^{-187}:\\ \;\;\;\;x \cdot t\\ \mathbf{elif}\;y \leq 5.5 \cdot 10^{-188}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y \leq 7.6 \cdot 10^{-54}:\\ \;\;\;\;x \cdot \left(t + y \cdot 2\right)\\ \mathbf{else}:\\ \;\;\;\;t_2\\ \end{array} \]
Alternative 6
Error14.9
Cost976
\[\begin{array}{l} t_1 := y \cdot \left(5 + x \cdot 2\right)\\ \mathbf{if}\;y \leq -2.2 \cdot 10^{-14}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y \leq -3.9 \cdot 10^{-105}:\\ \;\;\;\;y \cdot 5 + x \cdot t\\ \mathbf{elif}\;y \leq -4 \cdot 10^{-123}:\\ \;\;\;\;\left(y + z\right) \cdot \left(x \cdot 2\right)\\ \mathbf{elif}\;y \leq 3.4 \cdot 10^{+35}:\\ \;\;\;\;x \cdot \left(t + z \cdot 2\right)\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 7
Error10.3
Cost972
\[\begin{array}{l} t_1 := x \cdot \left(\left(y + z\right) \cdot 2 + t\right)\\ \mathbf{if}\;x \leq -0.1:\\ \;\;\;\;t_1\\ \mathbf{elif}\;x \leq -2.9 \cdot 10^{-165}:\\ \;\;\;\;y \cdot 5 + x \cdot t\\ \mathbf{elif}\;x \leq 2.22 \cdot 10^{-94}:\\ \;\;\;\;y \cdot 5 + 2 \cdot \left(x \cdot z\right)\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 8
Error0.1
Cost960
\[y \cdot 5 + x \cdot \left(t + \left(y + \left(z + \left(y + z\right)\right)\right)\right) \]
Alternative 9
Error0.1
Cost960
\[\left(x \cdot \left(\left(y + z\right) \cdot 2\right) + x \cdot t\right) + y \cdot 5 \]
Alternative 10
Error12.5
Cost841
\[\begin{array}{l} \mathbf{if}\;y \leq -4.05 \cdot 10^{+49} \lor \neg \left(y \leq 3.4 \cdot 10^{+35}\right):\\ \;\;\;\;y \cdot \left(5 + x \cdot 2\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(\left(y + z\right) \cdot 2 + t\right)\\ \end{array} \]
Alternative 11
Error14.5
Cost713
\[\begin{array}{l} \mathbf{if}\;y \leq -3.4 \cdot 10^{-18} \lor \neg \left(y \leq 3.4 \cdot 10^{+35}\right):\\ \;\;\;\;y \cdot \left(5 + x \cdot 2\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(t + z \cdot 2\right)\\ \end{array} \]
Alternative 12
Error32.8
Cost588
\[\begin{array}{l} \mathbf{if}\;x \leq -1.5 \cdot 10^{+113}:\\ \;\;\;\;x \cdot t\\ \mathbf{elif}\;x \leq -2.5:\\ \;\;\;\;2 \cdot \left(y \cdot x\right)\\ \mathbf{elif}\;x \leq 8.4 \cdot 10^{-100}:\\ \;\;\;\;y \cdot 5\\ \mathbf{else}:\\ \;\;\;\;x \cdot t\\ \end{array} \]
Alternative 13
Error32.2
Cost456
\[\begin{array}{l} \mathbf{if}\;x \leq -9.6 \cdot 10^{-18}:\\ \;\;\;\;x \cdot t\\ \mathbf{elif}\;x \leq 3.5 \cdot 10^{-97}:\\ \;\;\;\;y \cdot 5\\ \mathbf{else}:\\ \;\;\;\;x \cdot t\\ \end{array} \]
Alternative 14
Error47.0
Cost192
\[x \cdot t \]

Error

Reproduce?

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