(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 (fma b a (- (+ y (+ z x)) (fma z (log t) (* b 0.5)))))
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 fma(b, a, ((y + (z + x)) - fma(z, log(t), (b * 0.5))));
}
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 fma(b, a, Float64(Float64(y + Float64(z + x)) - fma(z, log(t), Float64(b * 0.5)))) 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[(b * a + N[(N[(y + N[(z + x), $MachinePrecision]), $MachinePrecision] - N[(z * N[Log[t], $MachinePrecision] + N[(b * 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\left(\left(\left(x + y\right) + z\right) - z \cdot \log t\right) + \left(a - 0.5\right) \cdot b
\mathsf{fma}\left(b, a, \left(y + \left(z + x\right)\right) - \mathsf{fma}\left(z, \log t, b \cdot 0.5\right)\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.3 |
| Herbie | 0.1 |
Initial program 0.1
Simplified0.1
Taylor expanded in z around 0 0.1
Applied add-cube-cbrt_binary640.5
Applied add-cube-cbrt_binary641.3
Applied prod-diff_binary641.3
Simplified0.1
Simplified0.1
Final simplification0.1
herbie shell --seed 2022129
(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)))