# ?

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

# ?

$\left(\left(\left(-1 \leq A_BW \land A_BW \leq 1\right) \land \left(-1 \leq Radius \land Radius \leq 1\right)\right) \land \left(-1 \leq K \land K \leq 1\right)\right) \land \left(-1 \leq A_BD \land A_BD \leq 1\right)$
$\frac{A_BW + Radius \cdot K}{A_BD}$
$\frac{\mathsf{fma}\left(Radius, K, A_BW\right)}{A_BD}$
(FPCore (A_BW Radius K A_BD)
:precision binary64
(/ (+ A_BW (* Radius K)) A_BD))
(FPCore (A_BW Radius K A_BD) :precision binary64 (/ (fma Radius K A_BW) A_BD))
double code(double A_BW, double Radius, double K, double A_BD) {
return (A_BW + (Radius * K)) / A_BD;
}

double code(double A_BW, double Radius, double K, double A_BD) {
return fma(Radius, K, A_BW) / A_BD;
}

function code(A_BW, Radius, K, A_BD)
return Float64(Float64(A_BW + Float64(Radius * K)) / A_BD)
end

function code(A_BW, Radius, K, A_BD)
return Float64(fma(Radius, K, A_BW) / A_BD)
end

code[A$95$BW_, Radius_, K_, A$95$BD_] := N[(N[(A$95$BW + N[(Radius * K), $MachinePrecision]),$MachinePrecision] / A$95$BD), $MachinePrecision]  code[A$95$BW_, Radius_, K_, A$95$BD_] := N[(N[(Radius * K + A$95$BW),$MachinePrecision] / A$95$BD), \$MachinePrecision]

\frac{A_BW + Radius \cdot K}{A_BD}

\frac{\mathsf{fma}\left(Radius, K, A_BW\right)}{A_BD}


# Derivation?

1. Initial program 0.0

$\frac{A_BW + Radius \cdot K}{A_BD}$
2. Simplified0.0

$\leadsto \color{blue}{\frac{\mathsf{fma}\left(Radius, K, A_BW\right)}{A_BD}}$
Proof
[Start]0.0 $\frac{A_BW + Radius \cdot K}{A_BD}$ $\frac{\color{blue}{Radius \cdot K + A_BW}}{A_BD}$ $\frac{\color{blue}{\mathsf{fma}\left(Radius, K, A_BW\right)}}{A_BD}$
3. Final simplification0.0

$\leadsto \frac{\mathsf{fma}\left(Radius, K, A_BW\right)}{A_BD}$

# Alternatives

Alternative 1
Error16.6
Cost452
$\begin{array}{l} \mathbf{if}\;Radius \leq 8.95 \cdot 10^{-144}:\\ \;\;\;\;\frac{A_BW}{A_BD}\\ \mathbf{else}:\\ \;\;\;\;Radius \cdot \frac{K}{A_BD}\\ \end{array}$
Alternative 2
Error0.0
Cost448
$\frac{A_BW + Radius \cdot K}{A_BD}$
Alternative 3
Error10.9
Cost192
$\frac{A_BW}{A_BD}$

# Reproduce?

herbie shell --seed 1
:precision binary64
:pre (and (and (and (and (<= -1.0 A_BW) (<= A_BW 1.0)) (and (<= -1.0 Radius) (<= Radius 1.0))) (and (<= -1.0 K) (<= K 1.0))) (and (<= -1.0 A_BD) (<= A_BD 1.0)))
(/ (+ A_BW (* Radius K)) A_BD))