Average Error: 6.2 → 0.3
Time: 5.5s
Precision: binary64
\[\]
\[\]

Error

Bits error versus x

Bits error versus y

Bits error versus z

Target

Original6.2
Target1.2
Herbie0.3
\[\]

Derivation

  1. Split input into 2 regimes
  2. if x < 2246989294872715

    1. Initial program 0.2

      \[\]
    2. Simplified0.2

      \[\leadsto \]
    3. Using strategy rm
    4. Applied flip--0.2

      \[\leadsto \]
    5. Applied associate-*l/0.2

      \[\leadsto \]
    6. Simplified0.2

      \[\leadsto \]

    if 2246989294872715 < x

    1. Initial program 11.0

      \[\]
    2. Simplified11.0

      \[\leadsto \]
    3. Taylor expanded around inf 11.1

      \[\leadsto \]
    4. Simplified0.4

      \[\leadsto \]
  3. Recombined 2 regimes into one program.
  4. Final simplification0.3

    \[\leadsto \]

Reproduce

herbie shell --seed 2020179 
(FPCore (x y z)
  :name "Numeric.SpecFunctions:$slogFactorial from math-functions-0.1.5.2, B"
  :precision binary64

  :herbie-target
  (+ (+ (+ (* (- x 0.5) (log x)) (- 0.91893853320467 x)) (/ 0.083333333333333 x)) (* (/ z x) (- (* z (+ y 0.0007936500793651)) 0.0027777777777778)))

  (+ (+ (- (* (- x 0.5) (log x)) x) 0.91893853320467) (/ (+ (* (- (* (+ y 0.0007936500793651) z) 0.0027777777777778) z) 0.083333333333333) x)))