(FPCore (x y z t a b) :precision binary64 (+ (- (+ (+ x y) z) (* z (log t))) (* (- a 0.5) b)))
(FPCore (x y z t a b) :precision binary64 (+ (+ (+ y (* z (- 1.0 (log t)))) (fma (- (log t)) z (* z (log t)))) (fma (+ a -0.5) b x)))
double code(double x, double y, double z, double t, double a, double b) {
return (((x + y) + z) - (z * log(t))) + ((a - 0.5) * b);
}
double code(double x, double y, double z, double t, double a, double b) {
return ((y + (z * (1.0 - log(t)))) + fma(-log(t), z, (z * log(t)))) + fma((a + -0.5), b, x);
}
function code(x, y, z, t, a, b) return Float64(Float64(Float64(Float64(x + y) + z) - Float64(z * log(t))) + Float64(Float64(a - 0.5) * b)) end
function code(x, y, z, t, a, b) return Float64(Float64(Float64(y + Float64(z * Float64(1.0 - log(t)))) + fma(Float64(-log(t)), z, Float64(z * log(t)))) + fma(Float64(a + -0.5), b, x)) end
code[x_, y_, z_, t_, a_, b_] := N[(N[(N[(N[(x + y), $MachinePrecision] + z), $MachinePrecision] - N[(z * N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(a - 0.5), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]
code[x_, y_, z_, t_, a_, b_] := N[(N[(N[(y + N[(z * N[(1.0 - N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[((-N[Log[t], $MachinePrecision]) * z + N[(z * N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(a + -0.5), $MachinePrecision] * b + x), $MachinePrecision]), $MachinePrecision]
\left(\left(\left(x + y\right) + z\right) - z \cdot \log t\right) + \left(a - 0.5\right) \cdot b
\left(\left(y + z \cdot \left(1 - \log t\right)\right) + \mathsf{fma}\left(-\log t, z, z \cdot \log t\right)\right) + \mathsf{fma}\left(a + -0.5, b, x\right)




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t




Bits error versus a




Bits error versus b
| Original | 0.1 |
|---|---|
| Target | 0.4 |
| Herbie | 0.1 |
Initial program 0.1
Simplified0.1
Taylor expanded in z around 0 0.1
Applied egg-rr0.1
Final simplification0.1
herbie shell --seed 2022150
(FPCore (x y z t a b)
:name "Numeric.SpecFunctions:logBeta from math-functions-0.1.5.2, A"
:precision binary64
:herbie-target
(+ (+ (+ x y) (/ (* (- 1.0 (pow (log t) 2.0)) z) (+ 1.0 (log t)))) (* (- a 0.5) b))
(+ (- (+ (+ x y) z) (* z (log t))) (* (- a 0.5) b)))