Average Error: 0.1 → 0.1
Time: 13.2s
Precision: binary64
\[\left(\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i \]
\[z + \left(t + \mathsf{fma}\left(i, y, \mathsf{fma}\left(0.5 - b, -\log c, \mathsf{fma}\left(\log y, x, a\right)\right)\right)\right) \]
(FPCore (x y z t a b c i)
 :precision binary64
 (+ (+ (+ (+ (+ (* x (log y)) z) t) a) (* (- b 0.5) (log c))) (* y i)))
(FPCore (x y z t a b c i)
 :precision binary64
 (+ z (+ t (fma i y (fma (- 0.5 b) (- (log c)) (fma (log y) x a))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	return (((((x * log(y)) + z) + t) + a) + ((b - 0.5) * log(c))) + (y * i);
}
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	return z + (t + fma(i, y, fma((0.5 - b), -log(c), fma(log(y), x, a))));
}
function code(x, y, z, t, a, b, c, i)
	return Float64(Float64(Float64(Float64(Float64(Float64(x * log(y)) + z) + t) + a) + Float64(Float64(b - 0.5) * log(c))) + Float64(y * i))
end
function code(x, y, z, t, a, b, c, i)
	return Float64(z + Float64(t + fma(i, y, fma(Float64(0.5 - b), Float64(-log(c)), fma(log(y), x, a)))))
end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(N[(N[(N[(N[(N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision] + z), $MachinePrecision] + t), $MachinePrecision] + a), $MachinePrecision] + N[(N[(b - 0.5), $MachinePrecision] * N[Log[c], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(y * i), $MachinePrecision]), $MachinePrecision]
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(z + N[(t + N[(i * y + N[(N[(0.5 - b), $MachinePrecision] * (-N[Log[c], $MachinePrecision]) + N[(N[Log[y], $MachinePrecision] * x + a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\left(\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i
z + \left(t + \mathsf{fma}\left(i, y, \mathsf{fma}\left(0.5 - b, -\log c, \mathsf{fma}\left(\log y, x, a\right)\right)\right)\right)

Error

Bits error versus x

Bits error versus y

Bits error versus z

Bits error versus t

Bits error versus a

Bits error versus b

Bits error versus c

Bits error versus i

Derivation

  1. Initial program 0.1

    \[\left(\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i \]
  2. Simplified0.1

    \[\leadsto \color{blue}{z + \left(t + \mathsf{fma}\left(x, \log y, \mathsf{fma}\left(y, i, \mathsf{fma}\left(b + -0.5, \log c, a\right)\right)\right)\right)} \]
  3. Applied egg-rr0.9

    \[\leadsto z + \left(t + \color{blue}{\sqrt[3]{\mathsf{fma}\left(x, \log y, \mathsf{fma}\left(y, i, \mathsf{fma}\left(b + -0.5, \log c, a\right)\right)\right)} \cdot {\left(\sqrt[3]{\mathsf{fma}\left(x, \log y, \mathsf{fma}\left(y, i, \mathsf{fma}\left(b + -0.5, \log c, a\right)\right)\right)}\right)}^{2}}\right) \]
  4. Taylor expanded in c around inf 0.1

    \[\leadsto z + \left(t + \color{blue}{\left(y \cdot i + \left(-1 \cdot \left(\left(b - 0.5\right) \cdot \log \left(\frac{1}{c}\right)\right) + \left(\log y \cdot x + a\right)\right)\right)}\right) \]
  5. Simplified0.1

    \[\leadsto z + \left(t + \color{blue}{\mathsf{fma}\left(i, y, \mathsf{fma}\left(-\left(b + -0.5\right), -\log c, \mathsf{fma}\left(\log y, x, a\right)\right)\right)}\right) \]
  6. Final simplification0.1

    \[\leadsto z + \left(t + \mathsf{fma}\left(i, y, \mathsf{fma}\left(0.5 - b, -\log c, \mathsf{fma}\left(\log y, x, a\right)\right)\right)\right) \]

Reproduce

herbie shell --seed 2022170 
(FPCore (x y z t a b c i)
  :name "Numeric.SpecFunctions:logBeta from math-functions-0.1.5.2, B"
  :precision binary64
  (+ (+ (+ (+ (+ (* x (log y)) z) t) a) (* (- b 0.5) (log c))) (* y i)))