code: def wrong_bits(rel_err):
      """Returns how many low-order bits `rel_err` corresponds to, in float32.
  
      In other words, if you see relative error `rel_err` on a
      (non-denomal) float-32 quantity, `wrong_bits(rel_err)` is the number
      of low-order bits that are wrong.
  
      Args:
        rel_err: Floating-point Tensor of relative error values.
  
      Returns:
        wrong: Tensor of elementwise corresponding wrong bits values, of the
          same dtype as `rel_err`.
      """
      log2 = tf.math.log(tf.constant(2.0, dtype=rel_err.dtype))
      # Negative wrong bits can only be an accident
      return tf.maximum(
          tf.math.log(tf.math.abs(rel_err)) / log2 + 24, 0
      )
  
file_path: probability/tensorflow_probability/python/internal/numerics_testing.py
imports: import functools
  from absl import logging
  import numpy
  import tensorflow.compat.v2
  from tensorflow_probability.python.internal import dtype_util
  from tensorflow_probability.python.math import gradient
label_desc: Use image node_id 5 for calling a global function with example usage: wrong_bits(rel_err) and returns: tf