\left(\left(\log \left(x + y\right) + \log z\right) - t\right) + \left(a - 0.5\right) \cdot \log t
\left(\frac{x}{y} + \mathsf{fma}\left(a, \log t, \log z\right)\right) - \left(t + \left(0.5 \cdot \left(\log t + \frac{x}{y} \cdot \frac{x}{y}\right) - \log y\right)\right)
(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 (- (+ (/ x y) (fma a (log t) (log z))) (+ t (- (* 0.5 (+ (log t) (* (/ x y) (/ x y)))) (log y)))))
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 ((x / y) + fma(a, log(t), log(z))) - (t + ((0.5 * (log(t) + ((x / y) * (x / y)))) - log(y)));
}




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 associate--l+_binary640.3
Taylor expanded in y around inf 7.8
Simplified0.3
Final simplification0.3
herbie shell --seed 2021280
(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))))