| Alternative 1 | |
|---|---|
| Error | 11.1 |
| Cost | 521 |
\[\begin{array}{l}
\mathbf{if}\;y \leq -1.12 \cdot 10^{-65} \lor \neg \left(y \leq 3.9 \cdot 10^{-18}\right):\\
\;\;\;\;y \cdot \left(-y\right)\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\]
(FPCore (x y) :precision binary64 (- x (* y y)))
(FPCore (x y) :precision binary64 (fma y (- y) x))
double code(double x, double y) {
return x - (y * y);
}
double code(double x, double y) {
return fma(y, -y, x);
}
function code(x, y) return Float64(x - Float64(y * y)) end
function code(x, y) return fma(y, Float64(-y), x) end
code[x_, y_] := N[(x - N[(y * y), $MachinePrecision]), $MachinePrecision]
code[x_, y_] := N[(y * (-y) + x), $MachinePrecision]
x - y \cdot y
\mathsf{fma}\left(y, -y, x\right)
Initial program 0.0
Taylor expanded in x around 0 0.0
Simplified0
[Start]0.0 | \[ -1 \cdot {y}^{2} + x
\] |
|---|---|
mul-1-neg [=>]0.0 | \[ \color{blue}{\left(-{y}^{2}\right)} + x
\] |
unpow2 [=>]0.0 | \[ \left(-\color{blue}{y \cdot y}\right) + x
\] |
distribute-rgt-neg-out [<=]0.0 | \[ \color{blue}{y \cdot \left(-y\right)} + x
\] |
fma-def [=>]0 | \[ \color{blue}{\mathsf{fma}\left(y, -y, x\right)}
\] |
Final simplification0
| Alternative 1 | |
|---|---|
| Error | 11.1 |
| Cost | 521 |
| Alternative 2 | |
|---|---|
| Error | 0.0 |
| Cost | 320 |
| Alternative 3 | |
|---|---|
| Error | 20.8 |
| Cost | 64 |
herbie shell --seed 2023054
(FPCore (x y)
:name "Graphics.Rasterific.Shading:$sradialGradientWithFocusShader from Rasterific-0.6.1"
:precision binary64
(- x (* y y)))