Average Error: 30.5 → 0.4
Time: 2.1s
Precision: binary64
\[\]
\[\]

Error

Bits error versus x

Derivation

  1. Split input into 2 regimes
  2. if x < 3.741153125096705e-310

    1. Initial program 30.4

      \[\]
    2. Simplified30.4

      \[\leadsto \]
    3. Taylor expanded around -inf 0.4

      \[\leadsto \]
    4. Simplified0.4

      \[\leadsto \]
    5. Using strategy rm
    6. Applied add-cube-cbrt0.4

      \[\leadsto \]
    7. Applied distribute-lft-neg-in0.4

      \[\leadsto \]
    8. Applied associate-*r*0.4

      \[\leadsto \]
    9. Simplified0.4

      \[\leadsto \]

    if 3.741153125096705e-310 < x

    1. Initial program 30.5

      \[\]
    2. Simplified30.5

      \[\leadsto \]
    3. Taylor expanded around 0 0.4

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

    \[\leadsto \]

Reproduce

herbie shell --seed 2020191 
(FPCore (x)
  :name "sqrt A"
  :precision binary64
  (sqrt (+ (* x x) (* x x))))