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




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t




Bits error versus a
Results
| Original | 0.3 |
|---|---|
| Target | 0.3 |
| Herbie | 0.3 |
Initial program 0.3
rmApplied add-cube-cbrt_binary64_89790.3
Applied log-prod_binary64_90300.3
Applied distribute-rgt-in_binary64_88940.3
Applied associate-+r+_binary64_88760.3
Simplified0.3
Taylor expanded around inf 0.4
Simplified0.3
Final simplification0.3
herbie shell --seed 2021043
(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))))