Average Error: 0.1 → 0.1
Time: 21.5s
Precision: binary64
Cost: 6976
\[\left(x \cdot y + z\right) \cdot y + t \]
\[\mathsf{fma}\left(x \cdot y, y, y \cdot z\right) + t \]
(FPCore (x y z t) :precision binary64 (+ (* (+ (* x y) z) y) t))
(FPCore (x y z t) :precision binary64 (+ (fma (* x y) y (* y z)) t))
double code(double x, double y, double z, double t) {
	return (((x * y) + z) * y) + t;
}
double code(double x, double y, double z, double t) {
	return fma((x * y), y, (y * z)) + t;
}
function code(x, y, z, t)
	return Float64(Float64(Float64(Float64(x * y) + z) * y) + t)
end
function code(x, y, z, t)
	return Float64(fma(Float64(x * y), y, Float64(y * z)) + t)
end
code[x_, y_, z_, t_] := N[(N[(N[(N[(x * y), $MachinePrecision] + z), $MachinePrecision] * y), $MachinePrecision] + t), $MachinePrecision]
code[x_, y_, z_, t_] := N[(N[(N[(x * y), $MachinePrecision] * y + N[(y * z), $MachinePrecision]), $MachinePrecision] + t), $MachinePrecision]
\left(x \cdot y + z\right) \cdot y + t
\mathsf{fma}\left(x \cdot y, y, y \cdot z\right) + t

Error

Derivation

  1. Initial program 0.1

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

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

Alternatives

Alternative 1
Error9.6
Cost712
\[\begin{array}{l} t_1 := \left(y \cdot x + z\right) \cdot y\\ \mathbf{if}\;y \leq -1.02 \cdot 10^{+39}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y \leq 480:\\ \;\;\;\;z \cdot y + t\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 2
Error5.4
Cost712
\[\begin{array}{l} t_1 := z \cdot y + t\\ \mathbf{if}\;z \leq -2.35 \cdot 10^{+76}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq 1.16 \cdot 10^{+38}:\\ \;\;\;\;\left(y \cdot x\right) \cdot y + t\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 3
Error0.1
Cost704
\[\left(\left(x \cdot y\right) \cdot y + y \cdot z\right) + t \]
Alternative 4
Error25.9
Cost588
\[\begin{array}{l} \mathbf{if}\;t \leq -3.5 \cdot 10^{-11}:\\ \;\;\;\;t\\ \mathbf{elif}\;t \leq -2.7 \cdot 10^{-156}:\\ \;\;\;\;\left(x \cdot y\right) \cdot y\\ \mathbf{elif}\;t \leq 3.4 \cdot 10^{-81}:\\ \;\;\;\;y \cdot z\\ \mathbf{else}:\\ \;\;\;\;t\\ \end{array} \]
Alternative 5
Error12.5
Cost584
\[\begin{array}{l} t_1 := \left(x \cdot y\right) \cdot y\\ \mathbf{if}\;y \leq -8 \cdot 10^{+63}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y \leq 1.05 \cdot 10^{+159}:\\ \;\;\;\;z \cdot y + t\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 6
Error0.1
Cost576
\[\left(x \cdot y + z\right) \cdot y + t \]
Alternative 7
Error24.9
Cost456
\[\begin{array}{l} \mathbf{if}\;t \leq -9 \cdot 10^{-129}:\\ \;\;\;\;t\\ \mathbf{elif}\;t \leq 3.2 \cdot 10^{-78}:\\ \;\;\;\;y \cdot z\\ \mathbf{else}:\\ \;\;\;\;t\\ \end{array} \]
Alternative 8
Error29.7
Cost64
\[t \]

Error

Reproduce

herbie shell --seed 2023010 
(FPCore (x y z t)
  :name "Language.Haskell.HsColour.ColourHighlight:unbase from hscolour-1.23"
  :precision binary64
  (+ (* (+ (* x y) z) y) t))