\left(\left(\log \left(x + y\right) + \log z\right) - t\right) + \left(a - 0.5\right) \cdot \log t
\begin{array}{l}
t_1 := \log \left(\sqrt{z}\right)\\
\log \left(y + x\right) + \left(\left(t_1 + \mathsf{fma}\left(\log t, a - 0.5, t_1\right)\right) - t\right)
\end{array}
(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 (let* ((t_1 (log (sqrt z)))) (+ (log (+ y x)) (- (+ t_1 (fma (log t) (- a 0.5) t_1)) 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) {
double t_1 = log(sqrt(z));
return log((y + x)) + ((t_1 + fma(log(t), (a - 0.5), t_1)) - t);
}




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
Simplified0.3
Taylor expanded in a around 0 0.3
Simplified0.3
Applied add-sqr-sqrt_binary640.3
Applied log-prod_binary640.3
Applied associate-+l+_binary640.3
Simplified0.3
Final simplification0.3
herbie shell --seed 2022125
(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))))