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

Error

Bits error versus x

Bits error versus y

Bits error versus z

Bits error versus t

Derivation

  1. Initial program 0.1

    \[\left(\left(x \cdot \log y - y\right) - z\right) + \log t \]
  2. Simplified0.1

    \[\leadsto \color{blue}{\mathsf{fma}\left(x, \log y, \log t\right) - \left(y + z\right)} \]
  3. Applied egg-rr0.1

    \[\leadsto \color{blue}{\mathsf{fma}\left(\log y, x, \log t - \left(y + z\right)\right)} \]
  4. Final simplification0.1

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

Reproduce

herbie shell --seed 2022150 
(FPCore (x y z t)
  :name "Numeric.SpecFunctions:incompleteGamma from math-functions-0.1.5.2, A"
  :precision binary64
  (+ (- (- (* x (log y)) y) z) (log t)))