Skip to content

Latest commit

 

History

History
166 lines (164 loc) · 3.61 KB

45.md

File metadata and controls

166 lines (164 loc) · 3.61 KB

Results of GPT-4 on HumanEval/45

Date: 18 July, 2023
Model: gpt-4
Temperature: 0.2
Passing runs: 10
Total runs: 10
Success rate: 100%

Prompt

Tokens: 72

def triangle_area(a, h):
    """Given length of a side and high return area for a triangle.
    >>> triangle_area(5, 3)
    7.5
    """

The above is an incomplete Python code fragment. Return the complete and correct code with no additional text.

Correct solution

def triangle_area(a, h):
    """Given length of a side and high return area for a triangle.
    >>> triangle_area(5, 3)
    7.5
    """return a * h / 2.0

Unit tests

METADATA = {}


def check(candidate):
    assert candidate(5, 3) == 7.5
    assert candidate(2, 2) == 2.0
    assert candidate(10, 8) == 40.0

Runs

✅ Run 1

Start time: 2023-07-18 18:38:44
Duration: 4.6s
Completion tokens: 50
Result: Pass

def triangle_area(a, h):
    """Given length of a side and high return area for a triangle.
    >>> triangle_area(5, 3)
    7.5
    """
    return 0.5 * a * h

✅ Run 2

Start time: 2023-07-18 18:38:40
Duration: 4.23s
Completion tokens: 55
Result: Pass

def triangle_area(a, h):
    """Given length of a side and high return area for a triangle.
    >>> triangle_area(5, 3)
    7.5
    """
    return 0.5 * a * h

✅ Run 3

Start time: 2023-07-18 18:38:35
Duration: 5.57s
Completion tokens: 50
Result: Pass

def triangle_area(a, h):
    """Given length of a side and high return area for a triangle.
    >>> triangle_area(5, 3)
    7.5
    """
    return 0.5 * a * h

✅ Run 4

Start time: 2023-07-18 18:38:29
Duration: 5.38s
Completion tokens: 55
Result: Pass

def triangle_area(a, h):
    """Given length of a side and high return area for a triangle.
    >>> triangle_area(5, 3)
    7.5
    """
    return 0.5 * a * h

✅ Run 5

Start time: 2023-07-18 18:38:24
Duration: 5.37s
Completion tokens: 50
Result: Pass

def triangle_area(a, h):
    """Given length of a side and high return area for a triangle.
    >>> triangle_area(5, 3)
    7.5
    """
    return 0.5 * a * h

✅ Run 6

Start time: 2023-07-18 18:38:16
Duration: 7.29s
Completion tokens: 50
Result: Pass

def triangle_area(a, h):
    """Given length of a side and high return area for a triangle.
    >>> triangle_area(5, 3)
    7.5
    """
    return 0.5 * a * h

✅ Run 7

Start time: 2023-07-18 18:38:10
Duration: 6.16s
Completion tokens: 55
Result: Pass

def triangle_area(a, h):
    """Given length of a side and high return area for a triangle.
    >>> triangle_area(5, 3)
    7.5
    """
    return 0.5 * a * h

✅ Run 8

Start time: 2023-07-18 18:38:05
Duration: 4.6s
Completion tokens: 55
Result: Pass

def triangle_area(a, h):
    """Given length of a side and high return area for a triangle.
    >>> triangle_area(5, 3)
    7.5
    """
    return 0.5 * a * h

✅ Run 9

Start time: 2023-07-18 18:38:02
Duration: 3.77s
Completion tokens: 50
Result: Pass

def triangle_area(a, h):
    """Given length of a side and high return area for a triangle.
    >>> triangle_area(5, 3)
    7.5
    """
    return 0.5 * a * h

✅ Run 10

Start time: 2023-07-18 18:37:57
Duration: 4.77s
Completion tokens: 55
Result: Pass

def triangle_area(a, h):
    """Given length of a side and high return area for a triangle.
    >>> triangle_area(5, 3)
    7.5
    """
    return 0.5 * a * h