?

Average Accuracy: 68.0% → 68.0%
Time: 9.7s
Precision: binary64
Cost: 6976

?

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

Error?

Derivation?

  1. Initial program 66.4%

    \[\left(x \cdot y + z \cdot t\right) + a \cdot b \]
  2. Simplified66.4%

    \[\leadsto \color{blue}{\mathsf{fma}\left(x, y, z \cdot t\right) + a \cdot b} \]
    Step-by-step derivation

    [Start]66.4

    \[ \left(x \cdot y + z \cdot t\right) + a \cdot b \]

    fma-def [=>]66.4

    \[ \color{blue}{\mathsf{fma}\left(x, y, z \cdot t\right)} + a \cdot b \]
  3. Final simplification66.4%

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

Alternatives

Alternative 1
Accuracy28.8%
Cost1515
\[\begin{array}{l} \mathbf{if}\;t \leq -6 \cdot 10^{-81}:\\ \;\;\;\;z \cdot t\\ \mathbf{elif}\;t \leq -9.6 \cdot 10^{-215}:\\ \;\;\;\;x \cdot y\\ \mathbf{elif}\;t \leq 1.18 \cdot 10^{-231}:\\ \;\;\;\;a \cdot b\\ \mathbf{elif}\;t \leq 1.5 \cdot 10^{-176}:\\ \;\;\;\;x \cdot y\\ \mathbf{elif}\;t \leq 4 \cdot 10^{-120} \lor \neg \left(t \leq 1.9 \cdot 10^{-102}\right) \land \left(t \leq 1.05 \cdot 10^{-55} \lor \neg \left(t \leq 5.6 \cdot 10^{+59}\right) \land \left(t \leq 8 \cdot 10^{+174} \lor \neg \left(t \leq 8.6 \cdot 10^{+199}\right)\right)\right):\\ \;\;\;\;z \cdot t\\ \mathbf{else}:\\ \;\;\;\;a \cdot b\\ \end{array} \]
Alternative 2
Accuracy46.4%
Cost977
\[\begin{array}{l} \mathbf{if}\;y \leq -3.7 \cdot 10^{-117}:\\ \;\;\;\;x \cdot y\\ \mathbf{elif}\;y \leq 2.15 \cdot 10^{+18} \lor \neg \left(y \leq 4.2 \cdot 10^{+117}\right) \land y \leq 1.35 \cdot 10^{+167}:\\ \;\;\;\;a \cdot b + z \cdot t\\ \mathbf{else}:\\ \;\;\;\;a \cdot b + x \cdot y\\ \end{array} \]
Alternative 3
Accuracy51.6%
Cost977
\[\begin{array}{l} \mathbf{if}\;y \leq -8.6 \cdot 10^{-180}:\\ \;\;\;\;x \cdot y + z \cdot t\\ \mathbf{elif}\;y \leq 1.75 \cdot 10^{+18} \lor \neg \left(y \leq 4.4 \cdot 10^{+117}\right) \land y \leq 1.3 \cdot 10^{+167}:\\ \;\;\;\;a \cdot b + z \cdot t\\ \mathbf{else}:\\ \;\;\;\;a \cdot b + x \cdot y\\ \end{array} \]
Alternative 4
Accuracy35.4%
Cost712
\[\begin{array}{l} \mathbf{if}\;a \cdot b \leq -2.1 \cdot 10^{+46}:\\ \;\;\;\;a \cdot b\\ \mathbf{elif}\;a \cdot b \leq 1.6 \cdot 10^{-63}:\\ \;\;\;\;z \cdot t\\ \mathbf{else}:\\ \;\;\;\;a \cdot b\\ \end{array} \]
Alternative 5
Accuracy44.1%
Cost712
\[\begin{array}{l} \mathbf{if}\;y \leq -3.7 \cdot 10^{-117}:\\ \;\;\;\;x \cdot y\\ \mathbf{elif}\;y \leq 2.8 \cdot 10^{+171}:\\ \;\;\;\;a \cdot b + z \cdot t\\ \mathbf{else}:\\ \;\;\;\;x \cdot y\\ \end{array} \]
Alternative 6
Accuracy68.0%
Cost704
\[a \cdot b + \left(x \cdot y + z \cdot t\right) \]
Alternative 7
Accuracy23.7%
Cost192
\[a \cdot b \]

Error

Reproduce?

herbie shell --seed 2023157 
(FPCore (x y z t a b)
  :name "Linear.V3:$cdot from linear-1.19.1.3, B"
  :precision binary64
  (+ (+ (* x y) (* z t)) (* a b)))