Average Error: 0.1 → 0.1
Time: 27.5s
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 \]
\[\mathsf{fma}\left(y, i, \left(a + \left(t + \left(\log y \cdot x + \left(\log c \cdot b + z\right)\right)\right)\right) - \log c \cdot 0.5\right) \]
\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
\mathsf{fma}\left(y, i, \left(a + \left(t + \left(\log y \cdot x + \left(\log c \cdot b + z\right)\right)\right)\right) - \log c \cdot 0.5\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
 (fma
  y
  i
  (- (+ a (+ t (+ (* (log y) x) (+ (* (log c) b) z)))) (* (log c) 0.5))))
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 fma(y, i, ((a + (t + ((log(y) * x) + ((log(c) * b) + z)))) - (log(c) * 0.5)));
}

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}{\mathsf{fma}\left(y, i, \mathsf{fma}\left(b - 0.5, \log c, \left(\mathsf{fma}\left(x, \log y, z\right) + t\right) + a\right)\right)} \]
  3. Taylor expanded in b around 0 0.1

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

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

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

Reproduce

herbie shell --seed 2021280 
(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)))