| Alternative 1 | |
|---|---|
| Error | 16.8 |
| Cost | 456 |
\[\begin{array}{l}
\mathbf{if}\;x \leq -6.8 \cdot 10^{+38}:\\
\;\;\;\;x\\
\mathbf{elif}\;x \leq 6 \cdot 10^{-16}:\\
\;\;\;\;-0.375 \cdot y\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\]
(FPCore (x y) :precision binary64 (- x (* (/ 3.0 8.0) y)))
(FPCore (x y) :precision binary64 (fma -0.375 y x))
double code(double x, double y) {
return x - ((3.0 / 8.0) * y);
}
double code(double x, double y) {
return fma(-0.375, y, x);
}
function code(x, y) return Float64(x - Float64(Float64(3.0 / 8.0) * y)) end
function code(x, y) return fma(-0.375, y, x) end
code[x_, y_] := N[(x - N[(N[(3.0 / 8.0), $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision]
code[x_, y_] := N[(-0.375 * y + x), $MachinePrecision]
x - \frac{3}{8} \cdot y
\mathsf{fma}\left(-0.375, y, x\right)
Initial program 0.1
Simplified0
| Alternative 1 | |
|---|---|
| Error | 16.8 |
| Cost | 456 |
| Alternative 2 | |
|---|---|
| Error | 0.1 |
| Cost | 320 |
| Alternative 3 | |
|---|---|
| Error | 31.7 |
| Cost | 64 |
herbie shell --seed 2023010
(FPCore (x y)
:name "Diagrams.Solve.Polynomial:quartForm from diagrams-solve-0.1, A"
:precision binary64
(- x (* (/ 3.0 8.0) y)))