(FPCore (x y z t a) :precision binary64 (+ (- (+ (log (+ x y)) (log z)) t) (* (- a 0.5) (log t))))
(FPCore (x y z t a) :precision binary64 (- (fma (log t) -0.5 (+ (log (+ y x)) (fma a (log t) (log z)))) t))
double code(double x, double y, double z, double t, double a) {
return ((log((x + y)) + log(z)) - t) + ((a - 0.5) * log(t));
}
double code(double x, double y, double z, double t, double a) {
return fma(log(t), -0.5, (log((y + x)) + fma(a, log(t), log(z)))) - t;
}
function code(x, y, z, t, a) return Float64(Float64(Float64(log(Float64(x + y)) + log(z)) - t) + Float64(Float64(a - 0.5) * log(t))) end
function code(x, y, z, t, a) return Float64(fma(log(t), -0.5, Float64(log(Float64(y + x)) + fma(a, log(t), log(z)))) - t) end
code[x_, y_, z_, t_, a_] := N[(N[(N[(N[Log[N[(x + y), $MachinePrecision]], $MachinePrecision] + N[Log[z], $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision] + N[(N[(a - 0.5), $MachinePrecision] * N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
code[x_, y_, z_, t_, a_] := N[(N[(N[Log[t], $MachinePrecision] * -0.5 + N[(N[Log[N[(y + x), $MachinePrecision]], $MachinePrecision] + N[(a * N[Log[t], $MachinePrecision] + N[Log[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]
\left(\left(\log \left(x + y\right) + \log z\right) - t\right) + \left(a - 0.5\right) \cdot \log t
\mathsf{fma}\left(\log t, -0.5, \log \left(y + x\right) + \mathsf{fma}\left(a, \log t, \log z\right)\right) - t




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t




Bits error versus a
| Original | 0.2 |
|---|---|
| Target | 0.2 |
| Herbie | 0.2 |
Initial program 0.2
Applied egg-rr0.2
Taylor expanded in z around 0 0.3
Simplified0.2
Final simplification0.2
herbie shell --seed 2022150
(FPCore (x y z t a)
:name "Numeric.SpecFunctions:logGammaL from math-functions-0.1.5.2"
:precision binary64
:herbie-target
(+ (log (+ x y)) (+ (- (log z) t) (* (- a 0.5) (log t))))
(+ (- (+ (log (+ x y)) (log z)) t) (* (- a 0.5) (log t))))