Average Error: 0.0 → 0.0
Time: 2.5s
Precision: binary64
\[e^{\left(x + y \cdot \log y\right) - z} \]
\[e^{\mathsf{fma}\left(\log y, y, x\right) - z} \]
(FPCore (x y z) :precision binary64 (exp (- (+ x (* y (log y))) z)))
(FPCore (x y z) :precision binary64 (exp (- (fma (log y) y x) z)))
double code(double x, double y, double z) {
	return exp(((x + (y * log(y))) - z));
}
double code(double x, double y, double z) {
	return exp((fma(log(y), y, x) - z));
}
function code(x, y, z)
	return exp(Float64(Float64(x + Float64(y * log(y))) - z))
end
function code(x, y, z)
	return exp(Float64(fma(log(y), y, x) - z))
end
code[x_, y_, z_] := N[Exp[N[(N[(x + N[(y * N[Log[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - z), $MachinePrecision]], $MachinePrecision]
code[x_, y_, z_] := N[Exp[N[(N[(N[Log[y], $MachinePrecision] * y + x), $MachinePrecision] - z), $MachinePrecision]], $MachinePrecision]
e^{\left(x + y \cdot \log y\right) - z}
e^{\mathsf{fma}\left(\log y, y, x\right) - z}

Error

Bits error versus x

Bits error versus y

Bits error versus z

Target

Original0.0
Target0.0
Herbie0.0
\[e^{\left(x - z\right) + \log y \cdot y} \]

Derivation

  1. Initial program 0.0

    \[e^{\left(x + y \cdot \log y\right) - z} \]
  2. Applied egg-rr0.0

    \[\leadsto e^{\color{blue}{\mathsf{fma}\left(\log y, y, x\right)} - z} \]
  3. Final simplification0.0

    \[\leadsto e^{\mathsf{fma}\left(\log y, y, x\right) - z} \]

Reproduce

herbie shell --seed 2022150 
(FPCore (x y z)
  :name "Statistics.Distribution.Poisson.Internal:probability from math-functions-0.1.5.2"
  :precision binary64

  :herbie-target
  (exp (+ (- x z) (* (log y) y)))

  (exp (- (+ x (* y (log y))) z)))