anchor.diff:      call test_cross_product(success)
       call test_bbox(success)
       call test_wiggle_interval(success)
  +    call test_contains_nd(success)
       call test_vector_close(success)
       call test_in_interval(success)
  +    call test_ulps_away(success)
   
     end subroutine helpers_all_tests
   
  
positive.code: 
    end subroutine test_wiggle_interval
  
    subroutine test_vector_close(success)
      logical(c_bool), intent(inout) :: success
      ! Variables outside of signature.
      logical(c_bool) :: is_close
      real(c_double) :: eps
      real(c_double) :: vec1(1, 2)
      real(c_double) :: vec2(1, 2)
  
      eps = 0.5_dp**40
  
  
negative.code: 
    end subroutine test_in_interval
  
    subroutine test_ulps_away(success)
      logical(c_bool), intent(inout) :: success
      ! Variables outside of signature.
      real(c_double) :: eps, value1, value2
      logical(c_bool) :: is_near
  
      eps = 0.5_dp**40
  
      ! CASE 1: First value is zero.
      is_near = ulps_away(0.0_dp, 0.0_dp, 1, eps)
      if (is_near) then
         write (*, "(A)") "      ulps_away: Case  1 success"
      else
         write (*, "(A)") "      ulps_away: Case  1 failure"
         success = .FALSE.
      end if
  
      ! CASE 2: Second value is zero.
      is_near = ulps_away(1.0_dp, 0.0_dp, 1, eps)
      if (.NOT. is_near) then
         write (*, "(A)") "      ulps_away: Case  2 success"
      else
         write (*, "(A)") "      ulps_away: Case  2 failure"
         success = .FALSE.
      end if
  
      ! CASE 3: First value positive **AND** negative.
      is_near = ulps_away(1.0_dp, 1.0_dp + machine_eps, 1, eps)
      if (is_near .AND. ulps_away(-1.0_dp, -1.0_dp - machine_eps, 1, eps)) then
         write (*, "(A)") "      ulps_away: Case  3 success"
      else
         write (*, "(A)") "      ulps_away: Case  3 failure"
         success = .FALSE.
      end if
  
      ! CASE 4: Boundaries where a single bit works.
      if ( &
           ulps_away(1.0_dp, 1.0_dp, 1, eps) .AND. &
           ulps_away(1.0_dp, 1.0_dp + machine_eps, 1, eps) .AND. &
           ulps_away(1.0_dp + machine_eps, 1.0_dp, 1, eps) .AND. &
           ulps_away(1.0_dp, 1.0_dp - machine_eps / 2, 1, eps) .AND. &
           ulps_away(1.0_dp - machine_eps / 2, 1.0_dp, 1, eps)) then
         write (*, "(A)") "      ulps_away: Case  4 success"
      else
         write (*, "(A)") "      ulps_away: Case  4 failure"
         success = .FALSE.
      end if
  
      ! CASE 5: Non-default ``num_bits``.
      value1 = 1.5_dp
      value2 = value1 + 0.5_dp**43
      if ( &
           .NOT. ulps_away(value1, value2, 1, eps) .AND. &
           ulps_away(value1, value2, 1000, eps)) then
         write (*, "(A)") "      ulps_away: Case  5 success"
      else
         write (*, "(A)") "      ulps_away: Case  5 failure"
         success = .FALSE.
      end if
  
      ! CASE 6: Very close, but not close enough.
      value1 = 0.25_dp - 5.625_dp * machine_eps
      value2 = 0.25_dp - 6.25_dp * machine_eps
      if ( &
           .NOT. ulps_away(value1, value2, 1, eps) .AND. &
           .NOT. ulps_away(value1, value2, 4, eps) .AND. &
           ulps_away(value1, value2, 5, eps)) then
         write (*, "(A)") "      ulps_away: Case  6 success"
      else
         write (*, "(A)") "      ulps_away: Case  6 failure"
         success = .FALSE.
      end if
  
    end subroutine test_ulps_away
  
  end module test_helpers
  