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




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t




Bits error versus a
Results
| Original | 0.2 |
|---|---|
| Target | 0.3 |
| Herbie | 0.2 |
Initial program 0.2
Simplified0.2
rmApplied *-un-lft-identity0.2
Final simplification0.2
herbie shell --seed 2020056 +o rules:numerics
(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))))