?

Average Error: 0.0 → 0.0
Time: 21.0s
Precision: binary64
Cost: 6720

?

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

Error?

Derivation?

  1. Initial program 0.0

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

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

Alternatives

Alternative 1
Error10.9
Cost848
\[\begin{array}{l} t_0 := \left(1 + x\right) \cdot y\\ \mathbf{if}\;y \leq -4.8 \cdot 10^{-31}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;y \leq 1.1 \cdot 10^{-103}:\\ \;\;\;\;x\\ \mathbf{elif}\;y \leq 1.8 \cdot 10^{-49}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;y \leq 1.12 \cdot 10^{-6}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \]
Alternative 2
Error10.6
Cost848
\[\begin{array}{l} t_0 := \left(1 + x\right) \cdot y\\ t_1 := \left(1 + y\right) \cdot x\\ \mathbf{if}\;y \leq -250000000:\\ \;\;\;\;t_0\\ \mathbf{elif}\;y \leq 5 \cdot 10^{-104}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y \leq 1.45 \cdot 10^{-49}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;y \leq 4500:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \]
Alternative 3
Error10.6
Cost848
\[\begin{array}{l} t_0 := \left(1 + x\right) \cdot y\\ \mathbf{if}\;y \leq -250000000:\\ \;\;\;\;t_0\\ \mathbf{elif}\;y \leq 1.7 \cdot 10^{-105}:\\ \;\;\;\;\left(1 + y\right) \cdot x\\ \mathbf{elif}\;y \leq 4.3 \cdot 10^{-47}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;y \leq 4500:\\ \;\;\;\;y \cdot x + x\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \]
Alternative 4
Error19.6
Cost592
\[\begin{array}{l} \mathbf{if}\;y \leq -4.2 \cdot 10^{-30}:\\ \;\;\;\;y\\ \mathbf{elif}\;y \leq 4.5 \cdot 10^{-103}:\\ \;\;\;\;x\\ \mathbf{elif}\;y \leq 1.1 \cdot 10^{-46}:\\ \;\;\;\;y\\ \mathbf{elif}\;y \leq 4500:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;y\\ \end{array} \]
Alternative 5
Error18.3
Cost592
\[\begin{array}{l} \mathbf{if}\;x \leq -4.1 \cdot 10^{+78}:\\ \;\;\;\;x\\ \mathbf{elif}\;x \leq -5 \cdot 10^{+15}:\\ \;\;\;\;y \cdot x\\ \mathbf{elif}\;x \leq -3.2 \cdot 10^{-35}:\\ \;\;\;\;x\\ \mathbf{elif}\;x \leq 1.56 \cdot 10^{-24}:\\ \;\;\;\;y\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]
Alternative 6
Error0.0
Cost448
\[\left(x \cdot y + x\right) + y \]
Alternative 7
Error35.7
Cost64
\[x \]

Error

Reproduce?

herbie shell --seed 2023033 
(FPCore (x y)
  :name "Numeric.Log:$cexpm1 from log-domain-0.10.2.1, B"
  :precision binary64
  (+ (+ (* x y) x) y))