| Alternative 1 | |
|---|---|
| Error | 0.1 |
| Cost | 13184 |
\[\mathsf{fma}\left(\log y, x, -y\right) - z
\]
(FPCore (x y z) :precision binary64 (- (- (* x (log y)) z) y))
(FPCore (x y z) :precision binary64 (fma x (log y) (- (- z) y)))
double code(double x, double y, double z) {
return ((x * log(y)) - z) - y;
}
double code(double x, double y, double z) {
return fma(x, log(y), (-z - y));
}
function code(x, y, z) return Float64(Float64(Float64(x * log(y)) - z) - y) end
function code(x, y, z) return fma(x, log(y), Float64(Float64(-z) - y)) end
code[x_, y_, z_] := N[(N[(N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision] - z), $MachinePrecision] - y), $MachinePrecision]
code[x_, y_, z_] := N[(x * N[Log[y], $MachinePrecision] + N[((-z) - y), $MachinePrecision]), $MachinePrecision]
\left(x \cdot \log y - z\right) - y
\mathsf{fma}\left(x, \log y, \left(-z\right) - y\right)
Initial program 0.1
Simplified0.1
[Start]0.1 | \[ \left(x \cdot \log y - z\right) - y
\] |
|---|---|
associate--l- [=>]0.1 | \[ \color{blue}{x \cdot \log y - \left(z + y\right)}
\] |
fma-neg [=>]0.1 | \[ \color{blue}{\mathsf{fma}\left(x, \log y, -\left(z + y\right)\right)}
\] |
distribute-neg-in [=>]0.1 | \[ \mathsf{fma}\left(x, \log y, \color{blue}{\left(-z\right) + \left(-y\right)}\right)
\] |
sub-neg [<=]0.1 | \[ \mathsf{fma}\left(x, \log y, \color{blue}{\left(-z\right) - y}\right)
\] |
Final simplification0.1
| Alternative 1 | |
|---|---|
| Error | 0.1 |
| Cost | 13184 |
| Alternative 2 | |
|---|---|
| Error | 10.2 |
| Cost | 6985 |
| Alternative 3 | |
|---|---|
| Error | 10.1 |
| Cost | 6985 |
| Alternative 4 | |
|---|---|
| Error | 12.5 |
| Cost | 6857 |
| Alternative 5 | |
|---|---|
| Error | 0.1 |
| Cost | 6848 |
| Alternative 6 | |
|---|---|
| Error | 31.0 |
| Cost | 456 |
| Alternative 7 | |
|---|---|
| Error | 30.8 |
| Cost | 392 |
| Alternative 8 | |
|---|---|
| Error | 21.1 |
| Cost | 256 |
| Alternative 9 | |
|---|---|
| Error | 42.4 |
| Cost | 128 |
herbie shell --seed 2023031
(FPCore (x y z)
:name "Statistics.Distribution.Poisson:$clogProbability from math-functions-0.1.5.2"
:precision binary64
(- (- (* x (log y)) z) y))