(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 (+ (log (+ y x)) (- (fma (log t) a (log z)) (fma (log t) 0.5 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 log((y + x)) + (fma(log(t), a, log(z)) - fma(log(t), 0.5, 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(log(Float64(y + x)) + Float64(fma(log(t), a, log(z)) - fma(log(t), 0.5, 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[Log[N[(y + x), $MachinePrecision]], $MachinePrecision] + N[(N[(N[Log[t], $MachinePrecision] * a + N[Log[z], $MachinePrecision]), $MachinePrecision] - N[(N[Log[t], $MachinePrecision] * 0.5 + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\left(\left(\log \left(x + y\right) + \log z\right) - t\right) + \left(a - 0.5\right) \cdot \log t
\log \left(y + x\right) + \left(\mathsf{fma}\left(\log t, a, \log z\right) - \mathsf{fma}\left(\log t, 0.5, t\right)\right)




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t




Bits error versus a
| Original | 0.3 |
|---|---|
| Target | 0.3 |
| Herbie | 0.3 |
Initial program 0.3
Applied egg-rr16.5
Taylor expanded in a around 0 0.3
Simplified0.3
Final simplification0.3
herbie shell --seed 2022166
(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))))